BLACK FRIDAY SALE: Save big on all my Swift books and bundles! >>

SOLVED: iExpense freezes after adding item

Forums > 100 Days of SwiftUI

Completed the iExpense project and it works (almost) fine. After I add an item and click 'Save', the item is added to the list, but then the + and 'Edit' buttons don't work (nothing happens when I click them). If I exit the simulator and restart it, it works fine, for one more item.

Wondering if anyone else has had this experience.


Might be able to help if you post the associated chunk of code or link to your project; also you might want to check if it is an unresolved Xcode bug or alike


Sorry, I'm new to this. I have files with the code on my iCloud drive. How do I insert it into my reply so it looks like code (formatted, with the black background)? I tried pasting it, but it just went in as text.


hi Pete,

it was routinely the case in most versions of XCode 11 that simulator + navigationbaritem with navigation links = not good. tapping on the nav bar button would work, then it wouldn't a second time. that may simply be what you are observing (you did not mention a version of XCode).

i went back to my completed iExpense project (XCode 11.6/iOS 13.6) and, indeed, tapping on the "plus" to add a second item is still unresponsive. however, if i swipe to delete (and it's not necessary that you actually delete) or do a "pull down to refresh" action, then tapping on the "plus" works again.

two things:

  • (i think) this behaviour was not ever present on a physical device -- it is unique to the simulator

  • the problem does not seem to be present in the simulator with XCode 12 beta 6/iOS 14

hope that helps,



Thanks, DMG. I tried swiping left after adding and, sure enough, I could add another item. I suspected the problem was with the simulator.

I'm using Xcode 11.6.



Hacking with Swift is sponsored by RevenueCat

SPONSORED In-app subscriptions are a pain to implement, hard to test, and full of edge cases. RevenueCat makes it straightforward and reliable so you can get back to building your app. Oh, and it's free if your app makes less than $10k/mo.

Learn 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.