Post

Replies

Boosts

Views

Activity

Reply to onDelete change label
Adding .swipeActions you can add Localized text or icon for swipe to delete case and the default .onDelete still hangs around to be used with EditButton() if you're using with iPhone and Mac app. Can add red trash icon which is universal instead of text. List { ForEach(myArray, id: \.id) { item in SomeView(item: item) .swipeActions(allowsFullSwipe: false) { Button(role: .destructive) { deleteItem(item: item) } label: { Label("Delete", systemImage: "trash.fill") // Can also add Localized Text here } } } .onDelete(perform: delete) .onMove { from, to in myArray.move(fromOffsets: from, toOffset: to) } } .toolbar { EditButton() } private func deleteItem(item: AltimetryItem) { if let index = myArray.firstIndex(where: { $0.id == item.id }) { withAnimation { myArray.remove(at: index) } } } func delete(at offsets: IndexSet) { myArray.remove(atOffsets: offsets) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’23
Reply to PlistBuddy denied writing the plist file with latest Xcode beta?
I'm thinking the answer lies in adding an output file in the run script but not sure how to do that or what file to add. I also don't think it's a good idea to switch off Sandboxing.
Replies
Boosts
Views
Activity
Mar ’24
Reply to onDelete change label
Adding .swipeActions you can add Localized text or icon for swipe to delete case and the default .onDelete still hangs around to be used with EditButton() if you're using with iPhone and Mac app. Can add red trash icon which is universal instead of text. List { ForEach(myArray, id: \.id) { item in SomeView(item: item) .swipeActions(allowsFullSwipe: false) { Button(role: .destructive) { deleteItem(item: item) } label: { Label("Delete", systemImage: "trash.fill") // Can also add Localized Text here } } } .onDelete(perform: delete) .onMove { from, to in myArray.move(fromOffsets: from, toOffset: to) } } .toolbar { EditButton() } private func deleteItem(item: AltimetryItem) { if let index = myArray.firstIndex(where: { $0.id == item.id }) { withAnimation { myArray.remove(at: index) } } } func delete(at offsets: IndexSet) { myArray.remove(atOffsets: offsets) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to New Mac - suddenly 'Invalid Provisioning Profile Signature'
I have just encountered this issue. My certificates were valid and the same app had previously been uploaded without any errors from the same machine. The resolution for me was going to Xcode Preferences, choosing the accounts tab and clicking on download manual profiles. I am still using managed profile in my target.
Replies
Boosts
Views
Activity
Apr ’22
Reply to List view with .safeAreaInset modifier incorrect behavior
I have the same issue. Using ScrollView/LazyVStack for now which is not ideal. Have you found any solution?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’21