Post

Replies

Boosts

Views

Activity

Reply to SwiftUI: Text not updating
Where are you storing your data? Read up on ObservableObject, @Published vars, and @EnvironmentObjects. You basically create a data store (it's just a struct) somewhere, and set some vars as @Published. Then, you can either pass the data store through your View hierarchy as an @EnvironmentObject, or you can observe the variables. Call your API and store the updated data in the data store, and update your published vars. Once the published vars have changed, anything "observing" those vars will automatically update to show the new data. Example: let modelData: ModelData = ModelData() class ModelData : ObservableObject { @Published var latestData: Dictionary<String, Any> = getUpdatedData() @Published var latestTitle: String = "Nothing yet" } @main struct OpenAIApp : App { @EnvironmentObject var modelData: ModelData var body: some Scene { Text(modelData.latestTitle) } } That should work, but just read up on those things I mentioned so you get an understanding of how it works, and can apply it to your code.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22
Reply to App Store Review rejecting app because it references upcoming software
More fun. I deleted Xcode-beta. I deleted Xcode 14.0.1. I deleted DerivedData. I deleted the entire /Library/Developer folder. I rebooted. I installed Xcode 14.0.1 only. I built the app. It targets iOS 13 (iPadOS 13). App Review have rejected it again because "your app app or its metadata contains references to unreleased software". HOW CAN IT? They are being ZERO help. They don't give you any information as to where it might be referencing upcoming software. I've released app updates this week, including today, that target iOS 13. The only difference here is that this is an iPad app, and iPadOS 16 hasn't been released yet. But I'm not targeting iPadOS 16! How is anyone else releasing updates for iPad apps? It's so infuriating. If they won't help me I'll spend my time doing less annoying things, and keep muttering swear words in my head.
Sep ’22
Reply to App store claims that my app is linked to pre-release iPadOS 16
Same here. I've had 12 messages between us and every build is rejected but they don't give you any help or guidance. They just paste something from the agreement. My next step is to install Xcode 13.4.1 and build and archive it in there. If that's the fix then Apple and the App Review team need to get their act together. Xcode 14 should tell us we can't submit such a build at the validation stage and tell us why not. Instead, they let us go as far as App Review and get all this hassle and waste of time. So, install 13.4.1 and see if that works.
Sep ’22
Reply to App store claims that my app is linked to pre-release iPadOS 16
Just FYI if you didn't already realise, iPadOS 16 is not yet released so you can't build and reply for that version yet. Read my reply below. If Xcode 13.4.1 works then App Review should be telling us that's the fix, not stringing us along and not giving us any info. Apple get a bunch of things right, but these days they're getting more than 50% of things utterly wrong.
Sep ’22
Reply to Swift - Truncated text in UIAlertController
You haven't got any URL strings; you've got a String called urlString, and you're adding it into a very long message which is the same bit of text duplicated. No wonder the message is truncated. Can you reduce the message? Maybe something like: targ.et is not running or doesn't have entitlement 'com.apple.runningboard.assertions.webkit'. Are you sure, you want to redirect to %@ ?
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’22
Reply to App Store Review rejecting app because it references upcoming software
Yeah, the fix for this is to build your iPad apps with Xcode 13.4.1 and NOT with the released version of Xcode 14. This seems like a massive error on Apple's part. We all know that iPadOS 16 isn't released yet, so surely - when you validate and distribute your app - Xcode should inform us that we can't use that build, and stop us sending it in? Also, the App Review team must know the reason they're rejecting our apps? Surely they should just tell us to build our apps with Xcode 13.4.1 instead of just copying & pasting some text from the Developer Agreement that doesn't tell us anything we don't already know? This just smacks of utter incompetence on their part.
Sep ’22
Reply to Apple Watch (waiting for first unlock) in Xcode
I get this a lot, too. The only way I've found of fixing it is to quit Xcode, reboot the Watch, launch the iOS app manually (not build and deploy) and launch the Watch app manually (by tapping it on the Watch), then restarting Xcode. It occasionally works, but not every time. It really is ridiculous that these stupid little things get in the way of working. Xcode needs to realise that there is an iPhone with a paired watch connected. There's no reason for "Waiting for first unlock" to appear when your iPhone is plugged in and your Watch is unlocked and paired with your iPhone.
Sep ’22