UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

SOLVED: Issue with the HWS+ Ultimate Portfolio app - view closing itself

Forums > SwiftUI

I've been following along with the HWS+ Ultimate Portfolio videos (excellent stuff and learning loads) but I have an issue with the behaviour of my EditProjectView.

I first noticed it in video #36 when haptics were added closing/re-opening a project. I thought perhaps it was a feature and ignored it. But the problem has cropped up again in video #38 when adding local notifications and toggling the show reminders switch in EditProjectView.

The problem is whenever I close/re-open a project or toggle the show reminders switch in the EditProjectView, the view performs the required action but the closes and returns to either the Open Projects or Closed Project view as appropriate. In fact, the problem happens i.e. the view closes, if I make any changes on the form at all e.g. rename the project or change the description (form closes on first keypress) or change the project's colour.

I've scanned the code and can't see anything obvously wrong. I've also confirmed that this functionality does not exist in Paul's master app that he develops in the videos.

Any idea what cause a view to close itself?

Is anybody else having this problem with the HWS+ Ultimate Portfolio App?

Does anyone know if there is a master copy of the source code for the app than I can compare my code against?

Thanks

Gavin

3      

In case your interested, Paul H says this is a new SwiftUI bug that is fixed in Xcode 12.5, currently in beta.

4      

Thanks for the information. Just encountered the same problem.

Now I installed Xcode 12.5 Beta 3 and it works. But this has nothing to do with Xcode directly, the problem lies in iOS 14.4 which I tested in Xcode 12.5. iOS 14.5 beta fixes it.

What bothers me is that beginner and intermediate Swift developers would spend days and weeks trying everything not knowing whats wrong. Maybe not be able to update their app for a long time.

And I ask myself what is the cause of the problem and how would a professional Swift developer work around this ?

5      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

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.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.