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
8
votes
2 answers

iOS Application Background Downloading

Hey! I need to know how I can have my iOS Application start a download in the background of the application (like, have the download run in the AppDelegate file) so changing ViewControllers will not interrupt or cancel the download. I also need to…
Hank Brekke
  • 2,024
  • 2
  • 24
  • 33
8
votes
5 answers

Will ios terminate the app running in background after a specific time?

I am using core location framework inside my application and I set the location string in UIBackgroundMode or Required background modes(in Xcode 4.2) for getting the updated location from didUpdateToLocation method when app is running in background…
iosuser
  • 125
  • 1
  • 3
  • 10
8
votes
6 answers

Differentiate between applicationDidEnterBackground and applicationWillTermimate

In my application when user hits home button I save the data in NSUserDefaults. Application is running in background. When user re-launches the app I use the method applicationWillEnterForeground to display the saved data. However when user double…
Prerna chavan
  • 3,179
  • 7
  • 35
  • 77
7
votes
5 answers

UIApplicationLaunchOptionsKey not found

UIApplicationDelegate method - application(_:didFinishLaunchingWithOptions:) showing an error with Swift 4.2 (Xcode 10). UIApplicationLaunchOptionsKey not found What is replacement of UIApplicationLaunchOptionsKey in Swift 4.2?
Krunal
  • 77,632
  • 48
  • 245
  • 261
7
votes
3 answers

False positive respondsToSelector with UIApplicationDelegate leading to NSInvalidArgumentException

In short, the following code calls an existing selector in the super class, and then gives an NSInvalidException: - (void)applicationWillResignActive:(UIApplication *)application { if ([super…
Richard Le Mesurier
  • 29,432
  • 22
  • 140
  • 255
7
votes
3 answers

Application openURL gets called a few seconds after didFinishLaunchingWithOptions

I have a deep linking feature in my app that works fine beside one case. I have a 3 different onboarding pages according to the url that opened the app. So when the app is launched i need to know what link(if any) opened the app and then present the…
aviv_elk
  • 416
  • 1
  • 9
  • 21
7
votes
2 answers

iOS: how to detect when the UIApplicationDelegate state becomes "suspended"?

How can we detect when an iOS App has been suspended? There is no method that mentions this in the official UIApplicationDelegate documentation. These are the states that an App can have: (source: apple.com) Use case: I want to log when an app…
mm24
  • 9,280
  • 12
  • 75
  • 170
7
votes
2 answers

Force early call to background task expiration handler on iOS devices for testing

I am testing and debugging the expiration block in - beginBackgroundTaskWithExpirationHandler:. Is there a way to force the Block call so that it happens quicker, instead of waiting for about 10 minutes each time I need to debug it? I am not…
7
votes
5 answers

How to get navController from AppDelegate.

I am wondering, that how to get navController from AppDelegate = [[UIApplication sharedApplication] delegate] in the iPhone programming. e.g., in other viewController where we reference to the AppDelegate. In the applicationDelegate.h we…
6
votes
2 answers

display a modal view on ipad application startup

I want to conditionally display a login screen on launch of an ipad app. I don't want to make it part of a default segue, since they only need to login periodically, not every time. There are numerous examples of my question, but they all seem to…
6
votes
2 answers

Proper appDelegate method for Flurry startsession?

Flurry docs recommend placing the startSession call in applicationDidFinishLaunching:. Two problems with this... - (void)applicationDidFinishLaunching:(UIApplication *)application { [FlurryAnalytics startSession:@"AWESOMEAPIKEY"]; //…
Old McStopher
  • 6,295
  • 10
  • 60
  • 89
6
votes
3 answers

how to call an AppDelegate method from RootViewController without passing a delegate?

how to call an AppDelegate method from RootViewController without passing a delegate? Just wondering whether there is a way to do this? (or do I need to create a delegate object in the RootViewController to hold a reference to the AppDelegate)
Greg
  • 34,042
  • 79
  • 253
  • 454
6
votes
4 answers

iPhone application crash on launch

We are receiving a crash log from iTunes connect that is a little strange. We were preivously having problems with our app taking to long to return from ApplicationDidFinishLaunching. This was caused by doing a too much work inside of…
jmurphy
  • 1,891
  • 3
  • 22
  • 28
6
votes
1 answer

Transform UIApplicationDelegate methods into RxSwift Observables

In RxSwift / RxCocoa you can create a reactive wrapper for a delegate (e.g. UIScrollViewDelegate or CLLocationManagerDelegate) to enable Rx observable sequences for certain delegate methods. I am trying to implement this for the…
joern
  • 27,354
  • 7
  • 90
  • 105
6
votes
2 answers

Using applicationwillenterforeground for a passcode screen

Before iOS4, my app's initial view controller would check a passcode on/off settings variable in viewWillAppear and if set on, present a modal passcode screen that would stay there until the correct passcode was entered or the Home button was…
Matt Winters
  • 1,099
  • 2
  • 12
  • 22