Questions tagged [uiapplicationdelegate]

UIApplicationDelegate is a part of the UIKit framework used in iOS development

UIApplicationDelegate Protocol is available in /System/Library/Frameworks/UIKit.framework since iOS 2.0.

It declares methods that are implemented by the delegate of UIApplication object. It gives information on key events during application execution (finish launching, terminated, low memory, ...) (from iOS developer guide)

initial help

sample code

  • Could be found also in the official documentation
523 questions
6
votes
2 answers

How to test Background App Launch in case of NSURLSession(Background Session) event?

How can one test the scenario of Application Launch in background for handling Background NSURLSession's event? Flow: Application starts a upload/download task using Background URL session. User hits home button. App is in suspended or in…
Taha Samad
  • 1,135
  • 1
  • 9
  • 22
6
votes
1 answer

Is there a way to know my iOS app was killed by a privacy setting change?

My iOS app needs the privilege to access pictures to run properly. I was testing how my app was responding to changes in the privacy settings when I discovered the following: each time I go to the Settings apps and change the privacy setting for my…
Mick F
  • 7,312
  • 6
  • 51
  • 98
6
votes
1 answer

iOS: Push notifications, UIApplicationStateInactive and fast app switching

According to the Apple Docs, in order to find out if a user tapped on your push notification you are supposed to check the applicationState in application:didReceiveRemoteNotification: If the value is UIApplicationStateInactive, the user tapped the…
nrj
  • 1,701
  • 2
  • 22
  • 37
6
votes
3 answers

iOS - setIdleTimerDisabled:NO Not Working

I have an app that utilizes the video camera so the screen cannot dim. Inhibiting the screen from dimming works fine like so: - (void)applicationDidBecomeActive:(UIApplication *)application { [[UIApplication sharedApplication]…
Kevin_TA
  • 4,575
  • 13
  • 48
  • 77
6
votes
3 answers

present more than one modalview in appdelegate

I want to present a modalviewcontroller after every push-message the app recieves in "application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo" I present the viewcontroller like this: ReleaseViewController…
CrEaK
  • 127
  • 2
  • 6
5
votes
4 answers

applicationWillTerminate: not being called

I'm using applicationWillTerminate: to save some last-minute stuff. But the problem is that it never gets called. If I do something like this at the top of the method: NSLog(@"Something"); it doesn't get called and doesn't get outputted to the…
5
votes
0 answers

SceneDelegate.init() is being called when killing the app

I am experiencing some strange behavior in my app. Sometimes, when users kill the app, SceneDelegate.init() and scene(_:willConnectTo:options:) are called again which causes running the app init flow again. This results in some unexpected behavior…
5
votes
2 answers

How do you dismiss a UIActionSheet from the App Delegate?

I'm trying to dismiss a UIActionSheet from the app delegate so that it doesn't show again when you return from background. I've tried to dismiss the action sheet from the viewDidUnload or viewDidDisappear methods in the subclass view controller, but…
Dylan Gattey
  • 1,713
  • 13
  • 34
5
votes
2 answers

Alter view before applicationWillEnterForeground

I want to lock users out of my app after a period of being in the background. I'm catching this in the the AppDelegate's applicationWillEnterForeground (and comparing to time stored in applicationWillResignActive). If less than the timeout period…
Mitch Cohen
  • 1,551
  • 3
  • 15
  • 29
5
votes
3 answers

Quit app instead of entering background when receiving applicationDidEnterBackground

I wonder if it's possible to quit my program entirely after the user presses the Home button, rather than going into background run mode. Thanks.
chings228
  • 1,859
  • 24
  • 24
5
votes
0 answers

How should one handle iOS version-specific UIApplicationDelegate protocol method parameter types?

In iOS 12, the UIApplicationDelegate protocol defines: - (BOOL) application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray> *…
5
votes
3 answers

FBRequestDelegate only works on AppDelegate?

I want to encapsulate all my Facebook interactions within a FacebookFacade class to keep things clean and tidy. I have an instance of the iOS SDK Facebook class within my FacebookFacade. My problem is that when I make a Graph API call within the…
RMR
  • 51
  • 1
  • 2
5
votes
1 answer

locationManager(_:​did​Change​Authorization:​) executes when app first runs?

Does location​Manager(_:​did​Change​Authorization:​) get called whenever an app first runs, even if neither location manager method requestWhenInUseAuthorization() or startUpdatingLocation() has been called? I'm trying to report location at the…
5
votes
4 answers

When is ios auto screen capture taken?

I am trying to change the screen shot that is automatically captured by iOS when the app enters the background. However I am not entirely sure exactly when this screenshot is taken. For example: If you pull down the notification bar while in the app…
lostintranslation
  • 23,756
  • 50
  • 159
  • 262
5
votes
1 answer

Delegate Property for UIApplication

So I am starting to learn Core Data for iOS and have wrote this section of code out: - (void) viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; id delegate = [UIApplication sharedApplication].delegate; …