LAST CHANCE: Save 50% on all my Swift books and bundles! >>

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?




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


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 ?


Click here to save 50% on all my books and bundles!

Reply to this topic…

You need to create an account or log in to reply.

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.