It amazes me that they can just break something like this. It's low level stuff that you'd think a lot of UIs depend on.
Post
Replies
Boosts
Views
Activity
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.
I have the same question. Did you find an answer? I've tried a few things, but nothing works so far. I'm thinking of going back to AppKit for the main menu.
Same problem here and just started searching for answer. Did you find anything? I'll post an answer here if I do.
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. .
Any progress on this? I'm having similar problems. I have a local Swift package. It links fine with the app, and the app runs. But when I try to run the macOS tests I get linker errors that it doesn't see symbols from that package. Something is screwed up with multiplatform projects. (Xcode 13.4.1)
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.
Yeah, I need this too. I need to decide whether the ScrollView or the contained view should handle a drag event. It was possible in UIKit with the touchesShouldCancel method.
I submitted feedback with example project: FB9892547.
When I do "New" > "Playground..." in Xcode 13, I have a choice between iOS and macOS. I'm not sure how to change it after the fact, but maybe you need to make a new Playground and choose macOS?
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.
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) }
}
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.
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.
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.