Post

Replies

Boosts

Views

Activity

Reply to Bad: OutlineGroup is not lazy loading children?
I created an OutlineView package here: https://github.com/EncodiaDotCo/OutlineView to address this. It's the first time I've created a public github repo for a Swift package, so hopefully it's usable. It's not pretty yet but it lazy loads children. Maybe we can cooperate and improve it. Feel free to create bug/feature requests.
Jul ’22
Reply to linker failing for unit tests in multiplatform project
If it's the same problem I had, it's this: with multiplatform projects, those tests that Xcode creates for you are not unit tests, but "UI Tests". They do not link the same. You need to create more targets if you want to do unit testing. You'll see the Unit Test Bundle choice when you create a new target. I gave mine a similar name to the project template's UI Tests. So now I have "Tests macOS" and "Unit Tests macOS". The first is the UI Test bundle target created by Xcode. The second is my unit testing bundle. Linking works normally in there. .
Jun ’22
Reply to UIScrollView does not give touches to subview if drag starts quickly
My problem was caused by something dumb that I left out of my question, because I was trying to simplify it to post here. My UIScrollView was actually inside a SwiftUI view hierarchy, using UIViewRepresentable. Higher in that view hierarchy, there was a SwiftUI List, which also has scrolling. I had forgotten about that List because I was using it for it's layout appearance, grouping items into sections, but not for its scrolling. Once I got rid of that List, everything worked as expected.
Feb ’22
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) } }
Nov ’21