Post

Replies

Boosts

Views

Activity

Reply to Clearing an app’s memory, data etc.
This is an app/game you developed, right? If so, it's something you've done, not the system storing your previous game in its 'memory allocation'. Your app is reloading a previous game, or you've failed to wipe the game data from memory after you finished the game, so starting again simply plays from where you left off. It's your issue to fix. You need to architect the app better.
Topic: Community SubTopic: Apple Developers Tags:
May ’25
Reply to Problem with the note application
These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. If you feel this is a bug, you can raise a Feedback report here: https://feedbackassistant.apple.com/ If you don't think it's a bug, and is more of a question, I'd suggest you ask it over at the Apple Support Forums. Thanks.
May ’25
Reply to Xcode
Here's how it works: A developer writes the source code, and creates an app. The app is built and uploaded to an App Store Connect account. The app is made available on the App Store. Did someone wrote your app for you? If so, they will have the source code. You should ask them for it. If someone did not write the app for you, then how do you have an app on the App Store? Did you buy an app from some dodgy business that just packaged it for you and put it on the App Store?
May ’25
Reply to Clarification on Use of exit(0) in iOS App for Fatal Error Recovery
If the app has entered a non-functional state, how are you going to display an alert controller? If you're able to do something in the app, then killing it is not the right thing to do. You should wipe everything and take the user back to the menu screen, or whatever start page you have, and reload everything. It's a really poor user experience to do what you're suggesting. If I were running a game and it threw up an alert telling me the game is going to crash, please restart it, I'd delete the game.
Topic: App & System Services SubTopic: Core OS Tags:
May ’25
Reply to tabItem vs. Tab() — how to support iOS 17 and 18?
I'm not sure you should try to do this, for a couple of reasons. Look at some simple code that's written for iOS 17 and 18: if #available(iOS 18, *) { TabView(selection: $selectedTab) { Tab("Watch Now", systemImage: "play", value: .watchNow) { WatchNowView() } } } else { TabView(selection: $selectedTab) { MenuView() .tabItem { Label("Menu", systemImage: "list.dash") } OrderView() .tabItem { Label("Order", systemImage: "square.and.pencil") } } } First reason: The iOS 18 format has a specific Tab object which has its own title and image in the Tab item itself, whereas iOS 17's tabItems force you to create a Label instead. That would be difficult to work around. Second reason: Tab contains a View, whereas tabItem is a modifier on a View (just as .bold() is a modifier on a Text view). It's the opposite way round, making it difficult again. It might be cleaner to simply do something like this, and you can remove the unnecessary code when you no longer support iOS 17: if #available(iOS 18, *) { MyTabs(selectedTab: $selectedTab) } else { MyTabs_iOS17(selectedTab: $selectedTab) } ... struct MyTabs: View { @Binding var selectedTab: Tabs var body: some View { if #available(iOS 18, *) { TabView(selection: $selectedTab) { Tab("Watch Now", systemImage: "play", value: .watchNow) { WatchNowView() } } } } } struct MyTabs_iOS17: View { @Binding var selectedTab: Tabs var body: some View { TabView(selection: $selectedTab) { MenuView() .tabItem { Label("Menu", systemImage: "list.dash") } OrderView() .tabItem { Label("Order", systemImage: "square.and.pencil") } } } } There are ways to do this, but as I've mentioned, you'll be trying to fit A into B and C into D, and will have to write a chunk of code that makes that happen. It will likely be easier to bite the bullet and write the two separate sections.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’25
Reply to Notification message not displayed in sleep mode
No need for the second thread. You have an hour to edit your original post. Anyway, is this an app you're developing? (I'm guessing not as that looks like the Santander logo.) If it's not for an app you're developing then this is a consumer issue. These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
May ’25
Reply to ScreenBlur is not happening always when app goes to app switcher.
I've since moved onto Swift and SwiftUI, but when one of my apps was written in Objective-C this is what I used, and it worked every time. Perhaps it's because I'm using a UIImageView?: - (void)applicationWillResignActive:(UIApplication *)app { NSLog(@"AD: applicationWillResignActive"); [self showBlurView:YES]; } - (void)applicationWillEnterForeground:(UIApplication *)app { NSLog(@"AD: applicationWillEnterForeground"); [self showBlurView:NO]; } - (void)applicationDidBecomeActive:(UIApplication *)app { NSLog(@"AD: applicationDidBecomeActive"); [self showBlurView:NO]; } - (void)showBlurView:(BOOL)show { NSLog(@"AD: showBlurView: %@", show ? @"YES" : @"NO"); if(show) { blurView = [[UIImageView alloc] initWithFrame:self.window.frame]; blurView.image = [UIImage imageNamed:@"blurViewImage"]; [self.window addSubview:blurView]; } else { if(blurView != nil) { [blurView removeFromSuperview]; } } }
Topic: UI Frameworks SubTopic: UIKit
May ’25
Reply to ScreenBlur is not happening always when app goes to app switcher.
You've shown the time the cover view is added, but not the time it was removed. How long did a user take between putting the app into the app switcher (or background), and bringing it back to active? How long between those NSLogs? You're giving us piecemeal information here, making it difficult to help you. Also, note that I added an else to where you're checking for a nil. That's important, because if coverView isn't nil at that time, then it's not going to create the view. Add logging to every bit that's relevant.
Topic: UI Frameworks SubTopic: UIKit
May ’25
Reply to ScreenBlur is not happening always when app goes to app switcher.
// Add the view to the window -(void)applicationWillResignActive:(UIApplication *)application { NSLog(@"applicationWillResignActive"); // Confirm this method is being called NSLog(@"[self.window frame] = %@", NSStringFromCGRext([self.window frame])); // Confirm the frame is valid _coverView = [[UIView alloc]initWithFrame:[self.window frame]]; NSLog(@"applicationWillResignActive: Created view"); _coverView.backgroundColor =[UIColor blackColor]; [self.window addSubview:_coverView]; window.bringSubviewToFront(blurView); NSLog(@"applicationWillResignActive: View added and brought to the front"); } // Remove the view from the window - (void)applicationDidBecomeActive:(UIApplication *)application { NSLog(@"applicationDidBecomeActive"); // Confirm this method is being called if(_coverView != nil) { NSLog(@"applicationDidBecomeActive: _coverView is not nil, so removing it, and setting it to nil"); [_coverView removeFromSuperview]; _coverView = nil; } else { NSLog(@"applicationDidBecomeActive: _coverView is already nil"); } } You haven't provided us any evidence so far that you've added the logging to these methods, and so we can't tell exactly what the sequence of events is, so it's extremely difficult for us to debuig this from afar with little info. Put the comments in as I have above, and run it through until you see the problem occur, then copy the relevant text from the console and paste it here.
Topic: UI Frameworks SubTopic: UIKit
May ’25