Posts

Post not yet marked as solved
2 Replies
Are you invoking safeAddExercice asynchronously? If so, the EnvironmentObjects may not be set at the time the callback is applied because it is not happening during the lifecycle of the view. You could instead pass the environment object at the point when you schedule the exercise, thereby guaranteeing that the object will be available. E.g.: var body: some View { 		Button("Add Exercise") { 				let subman = self.subscriptionManager 				DispachQueue.main.async { 						safeAddExercice(subman) 				} 		} } func safeAddExercice(_ subman: SubscriptionManager) { 		// operate on subman rather than self.subscriptionManager }
Post not yet marked as solved
3 Replies
FWIW, I am also seeing this crash with a multi-color image: "xmark.octagon.fill"
Post not yet marked as solved
1 Replies
OutlineGroup is currently (as of beta6) rather buggy – many actions on simple lists cause crashes like this. My current work-around (which isn't really a work-around) is to just render a flattened list and indent child elements manually. You don't get the automatic disclosure indicators, but it works OK until the sidebar outline groups get working.
Post not yet marked as solved
2 Replies
FWIW, I've also experienced this issue, and filed it as FB8401910. LazyVStack is smooth up to a point, and then after 100 or so items it degrades to being unusable. We had to revert to using a UICollectionView wrapped in a UIViewRepresentable.
Post not yet marked as solved
5 Replies
We've run into this one as well (FB #FB7397761, FWIW). You can see our workaround at https://stackoverflow.com/questions/56910941/present-actionsheet-in-swiftui-on-ipad/58490096#58490096
Post not yet marked as solved
10 Replies
That's the exact crash I was getting … changing references of `Binding.value` to `Binding.wrappedValue` fixed it for me.Note that I don't think your toolchain is out of sync. The latest release of Xcode should have been labeled 'beta7', but shows up as 'beta6' in the app (Version 11.0 beta 6 (11M392r)). Apple has yet to acknowledge this *****-up, but the latest download does seem to be the correct one for the latest beta7 macOS 10.15 Beta (19A546d).
Post not yet marked as solved
10 Replies
I ran into something very similar. In my case, the symbol was "_$…SwiftUI7Binding…value…". The symbol still shows up in the module, so I'm not sure why it was crashing, but I changed all instances of Binding.value to Binding.wrappedValue, and that seems to have resolved that particular issue (there are a bunch of other new bugs, though).Your symbol however seems a bit different; I'm not sure how "Index" relates to Binding.
Post not yet marked as solved
6 Replies
Clever hack! It turns out that you can just do this, and it seems to work around the crash as well:public extension NSStepper { override func mouseEntered(with event: NSEvent) { // prevents crash in SwiftUI via NSHostingView.hoverRegionIdentifier } override func mouseExited(with event: NSEvent) { // prevents crash in SwiftUI via NSHostingView.hoverRegionIdentifier } }
Post not yet marked as solved
1 Replies
I'm doing something similar, and here's an example of the technique that I use:struct DynamicStackView: View { /// The key indicating the contents of the dynamic stack enum Indicator : String, CaseIterable { case altimeter, airspeed, vspeed, attitude, heading, turn } /// The indicators that are visible in the stack; this func visibleIndicators() -> [Indicator] { return Indicator.allCases.shuffled() // or whatever order you want… } /// Vends a view for the given indicator key func indicatorView(for indicator: Indicator) -> some View { switch indicator { case .altimeter: return Text("Too High!") case .airspeed: return Text("Too Fast!") case .vspeed: return Text("Going Up!") case .attitude: return Text("Banking!") case .heading: return Text("Wrong Way!") case .turn: return Text("Uncoordinated!") } } /// Builds the dynamic stack of indicators based on the indicator order returned from `visibleIndicators()` var dynamicStack: some View { HStack { ForEach(visibleIndicators(), id: \.self, content: self.indicatorView(for:)) } } var body: some View { dynamicStack } }Good luck with the app! I'm a pilot too, so let me know if you'd like my feedback on the design.