Thank you very much. That was exactly the solution I was looking for!
Post
Replies
Boosts
Views
Activity
Sorry, my error. I assumed this would be the case. Unfortunately top level code and swift concurrency does not yet work the way you expected.
And I misremembered how @main works.
Thank you for your answer. Unfortunately in this case this would not work, because Objective-C must be able to call these methods exactly with the specified names otherwise my app would not konform to the CBPeripheralDelegate protocol.
Thanks for your help and assessment of the problem. It already filed a bug report: FB9919924
Unfortunately all my bug reports of the last year never got any attention.
You are of course right! This one-liner even confused me, though I used many computed vars in Swift already. ;-)
The Question was „Why LazyHStack takes full height but HStack does not?“.
I thought I answered that.
What did I do wrong?
The beta last year, was not available for all developer program members.
This spring there was a more public beta. Let's hope it will be available for a larger group again, later this summer.
In this WWDC Video the reverse case is shown: NavigationStack inside of NavigationSplitView.
Still hoping both cases will be supported in later betas.
This should work, but there should also be an easier way. Come on Apple!
I'm glad, that I could help. Could you please mark the answer as „correct ✅“, if you feel this way?
Thank you, your answer was very helpful because it explained the reason for the warnings and gave a reasonable workaround which was not obvious for me!
PS: It would be really helpful to state something like the map workaround in the documentation of .notifications(named:...).
The literature about swift concurrency is still very sparse and though there are millions of blog entries explaining async await syntax and the simplest patterns there is still much missing when it comes to best practises and tricks like that above.
For an explanation see https://levelup.gitconnected.com/state-vs-stateobject-vs-observedobject-vs-environmentobject-in-swiftui-81e2913d63f9 and https://www.hackingwithswift.com/quick-start/swiftui/understanding-property-wrappers-in-swift-and-swiftui
You don't have to do anything in your code. You only have tell Xcode to include the file in your project.
Unfortunately I don't have the necessary steps available here today. But have you tried it already?
unfortunately this links to itself. Did you mean: https://developer.apple.com/forums/thread/742177