Post

Replies

Boosts

Views

Activity

Reply to List with EditButton for selection, delete, and move
I think so, but I'm not sure exactly what you're trying to do. Here, I copied the code from the documentation for EditButton, and added some ability to select by tapping the text. (Probably you want to render the selection in a different way, not just green text, but I did that for simplicity.) struct ContentView: View {     @State private var fruits = [         "Apple",         "Banana",         "Papaya",         "Mango"     ]     @State private var selected = Set<String>()     var body: some View {         NavigationView{             List {                 ForEach(fruits, id: \.self) { fruit in                     Text(fruit)                         .foregroundColor( selected.contains(fruit) ? Color.green : nil )                         .onTapGesture { toggleSelected(fruit) }                 }                 .onDelete { self.deleteFruit(at :$0) }                 .onMove { self.moveFruit(from: $0, to: $1) }             }             .navigationTitle("Fruits")             .toolbar { EditButton() }         }     }     func toggleSelected(_ fruit: String) {         if selected.contains(fruit) { selected.remove(fruit) }         else { selected.insert(fruit) }     }     func deleteFruit(at: IndexSet) { fruits.remove(atOffsets: at) }     func moveFruit(from: IndexSet, to: Int) { fruits.move(fromOffsets: from, toOffset: to) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’21
Reply to App reviews show up on App Store product page but not in App Store Connect
I have the opposite situation - I see a review in the "Connect" app on my iPad, but not in the App Store. I'm don't know why.
Replies
Boosts
Views
Activity
Nov ’21
Reply to List with EditButton for selection, delete, and move
I think so, but I'm not sure exactly what you're trying to do. Here, I copied the code from the documentation for EditButton, and added some ability to select by tapping the text. (Probably you want to render the selection in a different way, not just green text, but I did that for simplicity.) struct ContentView: View {     @State private var fruits = [         "Apple",         "Banana",         "Papaya",         "Mango"     ]     @State private var selected = Set<String>()     var body: some View {         NavigationView{             List {                 ForEach(fruits, id: \.self) { fruit in                     Text(fruit)                         .foregroundColor( selected.contains(fruit) ? Color.green : nil )                         .onTapGesture { toggleSelected(fruit) }                 }                 .onDelete { self.deleteFruit(at :$0) }                 .onMove { self.moveFruit(from: $0, to: $1) }             }             .navigationTitle("Fruits")             .toolbar { EditButton() }         }     }     func toggleSelected(_ fruit: String) {         if selected.contains(fruit) { selected.remove(fruit) }         else { selected.insert(fruit) }     }     func deleteFruit(at: IndexSet) { fruits.remove(atOffsets: at) }     func moveFruit(from: IndexSet, to: Int) { fruits.move(fromOffsets: from, toOffset: to) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Animating popover size changes
Did you ever find an answer? I have the same question. I have a popover that changes width and height and I'd like them to animate.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Debugging on iOS 15 is terribly slow in Xcode
My app starts fine, but if I stop on a breakpoint, the first load of the left panel (variables) takes a long time - about 10 seconds on a new MBPro. Once it's loaded things seem okay. Well I have other issues, like variables that I can't see or print, but that's not a speed issue.
Replies
Boosts
Views
Activity
Oct ’21
Reply to Swift package setup for a metal renderer
I wonder if there are any updates for this for swift-tools-version:5.5 (October 2021). I'd like to put metal shaders in a Swift package.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Are Button actions on the MainActor?
But the passed-in closure is meant to run on the main actor, and it is, it's just that the complier doesn't seem to understand that.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to UIDocument no longer saving, error in URLByAppendingPathExtension
Due to some problem with git, I'd lost the Info.plist definitions of the "Document Types" and "Exported Type Identifiers". Once I added those back, this error disappeared.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Side by side Picker wheels failing in iOS 15
Here's a simulator screenshot (iPhone SE). I've marked about where the border is, for the touch events. In my real app, with wider text, it's even further to the right, so that touching the first column of text actually spins the second picker.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’21