|
This has only just come up in Xcode 12 and iOS 14. I have an enum that determines which sheet to display. However, when I choose an option it does not update the view to show the correct view within the sheet. As an example, the code below will show the first view as it is the default value. However, if the third view is selected from the buttons, the first view will display regardless. The console says the enum has updated, but it appears the view is not updated. Strangely, the issue occurs until you choose any other options than the first one you select... Just an Xcode 12 bug or something I've done? Same issue occurs in both the simulator and on device. Any help is greatly appreciated.
I've applied the Hacking With Swift sample to show a second example..
Same issue with a Bool, when you tap on Success you get the Loading view. Unless you tap on Loading then Success you continue to see the loading view.
|
|
Try a different initializer for sheet. Make showView an Optional without initial value. The behaviour seems to have changed with iOS 14 but I found no documentation of this. You don't need the showSheet bool variable with this approach.
|
|
Thank you! I have zero idea why this has changed, assuming it is intentional. One less variable isn't a bad thing I suppose. The solution has broken the cancel button to the mail sheet via a UIRepresentable but I'll have a play. Thanks again. |
SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.