Post

Replies

Boosts

Views

Activity

How to do Add, View, Edit (with Cancel and Done)
I'm not sure how to pull off a viewer/editor with SwiftData + SwiftUI that supports Cancel I want the user to be able to: Tap + to bring up a sheet/form to create a new Item. The navigation bar shows Cancel and Create. Create is only enabled when the fields are mostly valid. Tap Create to do a deeper validation and add. Tap Cancel to not make any changes. Tap an item to view it. Tap Edit when viewing to edit. The navigation bar shows Cancel and Done. Done is only enabled when the fields are mostly valid. Tap Done to do a deeper validation and save changes. Tap Cancel to not make any changes. I think is a fairly common pattern. It's used by Contacts, for instance. I've got parts of this working. Creating is easy: I just insert it only after the user taps Create and it's validated. But Edit/Cancel/Done seems harder. If I disable autosaving the changes to the model, the changes are applied to other parts of SwiftUI immediately. And I haven't figured out how to cancel the changes. Should I be operating on a copy of the object instead? How do I copy it in a way that doesn't impact SwiftData? I'm happy to take any tips you might have, but if you want to look at the code and suggest something that way I put my test case up here: https://github.com/tewha/ItemEditor My hope is I can get this sample working, get the changes into my app, and keep the sample up for others to discover (though I feel this would also be a great concept for sample code).
1
0
511
Mar ’24
Manage subscriptions
We're trying to direct the user to subscription management.Apple documentation here:Letting Users Manage SubscriptionsSuggests opening this URL:https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptionsThis works fine on the Mac, but on iOS 10 I just get a white screen with the Carrier/Battery bar. This is true even if I just Paste that URL into Safari. What am I doing wrong?
4
0
6.1k
Oct ’16
Monterey Software Update
Is there any way to make Monterey Software Update a little more aggressive about detecting betas? I've posted a few bug reports since October 6th and apparently they're obsolete, or at least should have been checked with the latest beta. But despite using this laptop every day, I didn't see a new beta until I manually checked today. All those bug reports were just a waste of my and Apple's time…
0
0
595
Oct ’21
Sample project not working?
You can use the new project assistant in Xcode 12 (12A8189n) to create a iOS app project using SwiftUI, a SwiftUI App life cycle and Core Data. The resulting app seems fully functional on its back end, and SwiftUI previews work in the IDE… but when I run it to either simulator or device, it's just an empty white canvas. There's no items in the list (which I wouldn't necessarily expect), no Add button and no Edit button. I'm sure this is because this is unfinished and just a beta, but is there something I can do to make the project work? I'm not looking to ship something right now, but being able to play with these tools would be great.
2
0
1.5k
Sep ’20
What does CC_MD5's deprecation mean?
I get that it's compromised, but there are still services I need to access that need MD5 as a checksum. To me, a deprecated warning is different than an insecure warning. If CC_MD5 had a warning that it was insecure, I could ignore that for the tasks I need it for. I'd go through my code and rename my generic MD5 wrapper to be task specific and call it a day. But deprecated to me means I probably need to look for alternatives… not to MD5, since I need it, but to CC_MD5. Can I have some clarification?
1
1
3.6k
Jul ’19