Interface UIApplicationDelegate

    • Method Detail

      • applicationContinueUserActivityRestorationHandler

        default boolean applicationContinueUserActivityRestorationHandler​(@NotNull
                                                                          @NotNull UIApplication application,
                                                                          @NotNull
                                                                          @NotNull NSUserActivity userActivity,
                                                                          @NotNull
                                                                          @NotNull UIApplicationDelegate.Block_applicationContinueUserActivityRestorationHandler restorationHandler)
        Called on the main thread after the NSUserActivity object is available. Use the data you stored in the NSUserActivity object to re-create what the user was doing. You can create/fetch any restorable objects associated with the user activity, and pass them to the restorationHandler. They will then have the UIResponder restoreUserActivityState: method invoked with the user activity. Invoking the restorationHandler is optional. It may be copied and invoked later, and it will bounce to the main thread to complete its work and call restoreUserActivityState on all objects. API-Since: 8.0
      • applicationDidChangeStatusBarFrame

        @Deprecated
        default void applicationDidChangeStatusBarFrame​(@NotNull
                                                        @NotNull UIApplication application,
                                                        CGRect oldStatusBarFrame)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 13.0 Deprecated-Message: Use viewWillTransitionToSize:withTransitionCoordinator: instead.
      • applicationDidChangeStatusBarOrientation

        @Deprecated
        default void applicationDidChangeStatusBarOrientation​(@NotNull
                                                              @NotNull UIApplication application,
                                                              long oldStatusBarOrientation)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 13.0 Deprecated-Message: Use viewWillTransitionToSize:withTransitionCoordinator: instead.
      • applicationDidDecodeRestorableStateWithCoder

        default void applicationDidDecodeRestorableStateWithCoder​(@NotNull
                                                                  @NotNull UIApplication application,
                                                                  @NotNull
                                                                  @NotNull NSCoder coder)
        API-Since: 6.0
      • applicationDidFailToContinueUserActivityWithTypeError

        default void applicationDidFailToContinueUserActivityWithTypeError​(@NotNull
                                                                           @NotNull UIApplication application,
                                                                           @NotNull
                                                                           @NotNull java.lang.String userActivityType,
                                                                           @NotNull
                                                                           @NotNull NSError error)
        If the user activity cannot be fetched after willContinueUserActivityWithType is called, this will be called on the main thread when implemented. API-Since: 8.0
      • applicationDidFailToRegisterForRemoteNotificationsWithError

        default void applicationDidFailToRegisterForRemoteNotificationsWithError​(@NotNull
                                                                                 @NotNull UIApplication application,
                                                                                 @NotNull
                                                                                 @NotNull NSError error)
        API-Since: 3.0
      • applicationDidFinishLaunchingWithOptions

        default boolean applicationDidFinishLaunchingWithOptions​(@NotNull
                                                                 @NotNull UIApplication application,
                                                                 @Nullable
                                                                 @Nullable NSDictionary<java.lang.String,​?> launchOptions)
        API-Since: 3.0
      • applicationDidReceiveLocalNotification

        @Deprecated
        default void applicationDidReceiveLocalNotification​(@NotNull
                                                            @NotNull UIApplication application,
                                                            @NotNull
                                                            @NotNull UILocalNotification notification)
        Deprecated.
        API-Since: 4.0 Deprecated-Since: 10.0 Deprecated-Message: Use UserNotifications Framework's -[UNUserNotificationCenterDelegate willPresentNotification:withCompletionHandler:] or -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]
      • applicationDidReceiveRemoteNotification

        @Deprecated
        default void applicationDidReceiveRemoteNotification​(@NotNull
                                                             @NotNull UIApplication application,
                                                             @NotNull
                                                             @NotNull NSDictionary<?,​?> userInfo)
        Deprecated.
        API-Since: 3.0 Deprecated-Since: 10.0 Deprecated-Message: Use UserNotifications Framework's -[UNUserNotificationCenterDelegate willPresentNotification:withCompletionHandler:] or -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:] for user visible notifications and -[UIApplicationDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] for silent remote notifications
      • applicationDidReceiveRemoteNotificationFetchCompletionHandler

        default void applicationDidReceiveRemoteNotificationFetchCompletionHandler​(@NotNull
                                                                                   @NotNull UIApplication application,
                                                                                   @NotNull
                                                                                   @NotNull NSDictionary<?,​?> userInfo,
                                                                                   @NotNull
                                                                                   @NotNull UIApplicationDelegate.Block_applicationDidReceiveRemoteNotificationFetchCompletionHandler completionHandler)
        This delegate method offers an opportunity for applications with the "remote-notification" background mode to fetch appropriate new data in response to an incoming remote notification. You should call the fetchCompletionHandler as soon as you're finished performing that operation, so the system can accurately estimate its power and data cost. This method will be invoked even if the application was launched or resumed because of the remote notification. The respective delegate methods will be invoked first. Note that this behavior is in contrast to application:didReceiveRemoteNotification:, which is not called in those cases, and which will not be invoked if this method is implemented. ! API-Since: 7.0
      • applicationDidRegisterForRemoteNotificationsWithDeviceToken

        default void applicationDidRegisterForRemoteNotificationsWithDeviceToken​(@NotNull
                                                                                 @NotNull UIApplication application,
                                                                                 @NotNull
                                                                                 @NotNull NSData deviceToken)
        API-Since: 3.0
      • applicationDidRegisterUserNotificationSettings

        @Deprecated
        default void applicationDidRegisterUserNotificationSettings​(@NotNull
                                                                    @NotNull UIApplication application,
                                                                    @NotNull
                                                                    @NotNull UIUserNotificationSettings notificationSettings)
        Deprecated.
        This callback will be made upon calling -[UIApplication registerUserNotificationSettings:]. The settings the user has granted to the application will be passed in as the second argument. API-Since: 8.0 Deprecated-Since: 10.0 Deprecated-Message: Use UserNotifications Framework's -[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:]
      • applicationDidUpdateUserActivity

        default void applicationDidUpdateUserActivity​(@NotNull
                                                      @NotNull UIApplication application,
                                                      @NotNull
                                                      @NotNull NSUserActivity userActivity)
        This is called on the main thread when a user activity managed by UIKit has been updated. You can use this as a last chance to add additional data to the userActivity. API-Since: 8.0
      • applicationHandleActionWithIdentifierForLocalNotificationCompletionHandler

        @Deprecated
        default void applicationHandleActionWithIdentifierForLocalNotificationCompletionHandler​(@NotNull
                                                                                                @NotNull UIApplication application,
                                                                                                @Nullable
                                                                                                @Nullable java.lang.String identifier,
                                                                                                @NotNull
                                                                                                @NotNull UILocalNotification notification,
                                                                                                @NotNull
                                                                                                @NotNull UIApplicationDelegate.Block_applicationHandleActionWithIdentifierForLocalNotificationCompletionHandler completionHandler)
        Deprecated.
        Called when your app has been activated by the user selecting an action from a local notification. A nil action identifier indicates the default action. You should call the completion handler as soon as you've finished handling the action. API-Since: 8.0 Deprecated-Since: 10.0 Deprecated-Message: Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]
      • applicationHandleActionWithIdentifierForRemoteNotificationCompletionHandler

        @Deprecated
        default void applicationHandleActionWithIdentifierForRemoteNotificationCompletionHandler​(@NotNull
                                                                                                 @NotNull UIApplication application,
                                                                                                 @Nullable
                                                                                                 @Nullable java.lang.String identifier,
                                                                                                 @NotNull
                                                                                                 @NotNull NSDictionary<?,​?> userInfo,
                                                                                                 @NotNull
                                                                                                 @NotNull UIApplicationDelegate.Block_applicationHandleActionWithIdentifierForRemoteNotificationCompletionHandler completionHandler)
        Deprecated.
        Called when your app has been activated by the user selecting an action from a remote notification. A nil action identifier indicates the default action. You should call the completion handler as soon as you've finished handling the action. API-Since: 8.0 Deprecated-Since: 10.0 Deprecated-Message: Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]
      • applicationHandleEventsForBackgroundURLSessionCompletionHandler

        default void applicationHandleEventsForBackgroundURLSessionCompletionHandler​(@NotNull
                                                                                     @NotNull UIApplication application,
                                                                                     @NotNull
                                                                                     @NotNull java.lang.String identifier,
                                                                                     @NotNull
                                                                                     @NotNull UIApplicationDelegate.Block_applicationHandleEventsForBackgroundURLSessionCompletionHandler completionHandler)
        Applications using an NSURLSession with a background configuration may be launched or resumed in the background in order to handle the completion of tasks in that session, or to handle authentication. This method will be called with the identifier of the session needing attention. Once a session has been created from a configuration object with that identifier, the session's delegate will begin receiving callbacks. If such a session has already been created (if the app is being resumed, for instance), then the delegate will start receiving callbacks without any action by the application. You should call the completionHandler as soon as you're finished handling the callbacks. API-Since: 7.0
      • applicationHandleOpenURL

        @Deprecated
        default boolean applicationHandleOpenURL​(@NotNull
                                                 @NotNull UIApplication application,
                                                 @NotNull
                                                 @NotNull NSURL url)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 9.0
      • applicationOpenURLOptions

        default boolean applicationOpenURLOptions​(@NotNull
                                                  @NotNull UIApplication app,
                                                  @NotNull
                                                  @NotNull NSURL url,
                                                  @NotNull
                                                  @NotNull NSDictionary<java.lang.String,​?> options)
        no equiv. notification. return NO if the application can't open for some reason API-Since: 9.0
      • applicationOpenURLSourceApplicationAnnotation

        @Deprecated
        default boolean applicationOpenURLSourceApplicationAnnotation​(@NotNull
                                                                      @NotNull UIApplication application,
                                                                      @NotNull
                                                                      @NotNull NSURL url,
                                                                      @Nullable
                                                                      @Nullable java.lang.String sourceApplication,
                                                                      @NotNull
                                                                      @NotNull java.lang.Object annotation)
        Deprecated.
        API-Since: 4.2 Deprecated-Since: 9.0
      • applicationPerformFetchWithCompletionHandler

        @Deprecated
        default void applicationPerformFetchWithCompletionHandler​(@NotNull
                                                                  @NotNull UIApplication application,
                                                                  @NotNull
                                                                  @NotNull UIApplicationDelegate.Block_applicationPerformFetchWithCompletionHandler completionHandler)
        Deprecated.
        Applications with the "fetch" background mode may be given opportunities to fetch updated content in the background or when it is convenient for the system. This method will be called in these situations. You should call the fetchCompletionHandler as soon as you're finished performing that operation, so the system can accurately estimate its power and data cost. API-Since: 7.0 Deprecated-Since: 13.0 Deprecated-Message: Use a BGAppRefreshTask in the BackgroundTasks framework instead
      • applicationShouldAllowExtensionPointIdentifier

        default boolean applicationShouldAllowExtensionPointIdentifier​(@NotNull
                                                                       @NotNull UIApplication application,
                                                                       @NotNull
                                                                       @NotNull java.lang.String extensionPointIdentifier)
        Applications may reject specific types of extensions based on the extension point identifier. Constants representing common extension point identifiers are provided further down. If unimplemented, the default behavior is to allow the extension point identifier. API-Since: 8.0
      • applicationShouldRestoreApplicationState

        @Deprecated
        default boolean applicationShouldRestoreApplicationState​(@NotNull
                                                                 @NotNull UIApplication application,
                                                                 @NotNull
                                                                 @NotNull NSCoder coder)
        Deprecated.
        API-Since: 6.0 Deprecated-Since: 13.2 Deprecated-Message: Use application:shouldRestoreSecureApplicationState: instead
      • applicationShouldSaveApplicationState

        @Deprecated
        default boolean applicationShouldSaveApplicationState​(@NotNull
                                                              @NotNull UIApplication application,
                                                              @NotNull
                                                              @NotNull NSCoder coder)
        Deprecated.
        Deprecated State Restoration opt-in methods: API-Since: 6.0 Deprecated-Since: 13.2 Deprecated-Message: Use application:shouldSaveSecureApplicationState: instead
      • applicationSupportedInterfaceOrientationsForWindow

        default long applicationSupportedInterfaceOrientationsForWindow​(@NotNull
                                                                        @NotNull UIApplication application,
                                                                        @Nullable
                                                                        @Nullable UIWindow window)
        API-Since: 6.0
      • applicationUserDidAcceptCloudKitShareWithMetadata

        default void applicationUserDidAcceptCloudKitShareWithMetadata​(@NotNull
                                                                       @NotNull UIApplication application,
                                                                       @NotNull
                                                                       @NotNull CKShareMetadata cloudKitShareMetadata)
        This will be called on the main thread after the user indicates they want to accept a CloudKit sharing invitation in your application. You should use the CKShareMetadata object's shareURL and containerIdentifier to schedule a CKAcceptSharesOperation, then start using the resulting CKShare and its associated record(s), which will appear in the CKContainer's shared database in a zone matching that of the record's owner. API-Since: 10.0
      • applicationViewControllerWithRestorationIdentifierPathCoder

        @Nullable
        default @Nullable UIViewController applicationViewControllerWithRestorationIdentifierPathCoder​(@NotNull
                                                                                                       @NotNull UIApplication application,
                                                                                                       @NotNull
                                                                                                       @NotNull NSArray<java.lang.String> identifierComponents,
                                                                                                       @NotNull
                                                                                                       @NotNull NSCoder coder)
        API-Since: 6.0
      • applicationWillChangeStatusBarFrame

        @Deprecated
        default void applicationWillChangeStatusBarFrame​(@NotNull
                                                         @NotNull UIApplication application,
                                                         CGRect newStatusBarFrame)
        Deprecated.
        in screen coordinates API-Since: 2.0 Deprecated-Since: 13.0 Deprecated-Message: Use viewWillTransitionToSize:withTransitionCoordinator: instead.
      • applicationWillChangeStatusBarOrientationDuration

        @Deprecated
        default void applicationWillChangeStatusBarOrientationDuration​(@NotNull
                                                                       @NotNull UIApplication application,
                                                                       long newStatusBarOrientation,
                                                                       double duration)
        Deprecated.
        API-Since: 2.0 Deprecated-Since: 13.0 Deprecated-Message: Use viewWillTransitionToSize:withTransitionCoordinator: instead.
      • applicationWillContinueUserActivityWithType

        default boolean applicationWillContinueUserActivityWithType​(@NotNull
                                                                    @NotNull UIApplication application,
                                                                    @NotNull
                                                                    @NotNull java.lang.String userActivityType)
        Called on the main thread as soon as the user indicates they want to continue an activity in your application. The NSUserActivity object may not be available instantly, so use this as an opportunity to show the user that an activity will be continued shortly. For each application:willContinueUserActivityWithType: invocation, you are guaranteed to get exactly one invocation of application:continueUserActivity: on success, or application:didFailToContinueUserActivityWithType:error: if an error was encountered. API-Since: 8.0
      • applicationWillEncodeRestorableStateWithCoder

        default void applicationWillEncodeRestorableStateWithCoder​(@NotNull
                                                                   @NotNull UIApplication application,
                                                                   @NotNull
                                                                   @NotNull NSCoder coder)
        API-Since: 6.0
      • applicationWillFinishLaunchingWithOptions

        default boolean applicationWillFinishLaunchingWithOptions​(@NotNull
                                                                  @NotNull UIApplication application,
                                                                  @Nullable
                                                                  @Nullable NSDictionary<java.lang.String,​?> launchOptions)
        API-Since: 6.0
      • applicationDidBecomeActive

        default void applicationDidBecomeActive​(@NotNull
                                                @NotNull UIApplication application)
      • applicationDidEnterBackground

        default void applicationDidEnterBackground​(@NotNull
                                                   @NotNull UIApplication application)
        API-Since: 4.0
      • applicationDidFinishLaunching

        default void applicationDidFinishLaunching​(@NotNull
                                                   @NotNull UIApplication application)
      • applicationDidReceiveMemoryWarning

        default void applicationDidReceiveMemoryWarning​(@NotNull
                                                        @NotNull UIApplication application)
        try to clean up as much memory as possible. next step is to terminate app
      • applicationProtectedDataDidBecomeAvailable

        default void applicationProtectedDataDidBecomeAvailable​(@NotNull
                                                                @NotNull UIApplication application)
        API-Since: 4.0
      • applicationProtectedDataWillBecomeUnavailable

        default void applicationProtectedDataWillBecomeUnavailable​(@NotNull
                                                                   @NotNull UIApplication application)
        API-Since: 4.0
      • applicationShouldRequestHealthAuthorization

        default void applicationShouldRequestHealthAuthorization​(@NotNull
                                                                 @NotNull UIApplication application)
        API-Since: 9.0
      • applicationSignificantTimeChange

        default void applicationSignificantTimeChange​(@NotNull
                                                      @NotNull UIApplication application)
        midnight, carrier time update, daylight savings time change
      • applicationWillEnterForeground

        default void applicationWillEnterForeground​(@NotNull
                                                    @NotNull UIApplication application)
        API-Since: 4.0
      • applicationWillResignActive

        default void applicationWillResignActive​(@NotNull
                                                 @NotNull UIApplication application)
      • applicationWillTerminate

        default void applicationWillTerminate​(@NotNull
                                              @NotNull UIApplication application)
      • setWindow

        default void setWindow​(@Nullable
                               @Nullable UIWindow value)
        API-Since: 5.0
      • window

        @Nullable
        default @Nullable UIWindow window()
        API-Since: 5.0
      • applicationConfigurationForConnectingSceneSessionOptions

        @NotNull
        default @NotNull UISceneConfiguration applicationConfigurationForConnectingSceneSessionOptions​(@NotNull
                                                                                                       @NotNull UIApplication application,
                                                                                                       @NotNull
                                                                                                       @NotNull UISceneSession connectingSceneSession,
                                                                                                       @NotNull
                                                                                                       @NotNull UISceneConnectionOptions options)
        Called when the UIKit is about to create & vend a new UIScene instance to the application. The application delegate may modify the provided UISceneConfiguration within this method. If the UISceneConfiguration instance returned from this method does not have a systemType which matches the connectingSession's, UIKit will assert API-Since: 13.0
      • applicationDidDiscardSceneSessions

        default void applicationDidDiscardSceneSessions​(@NotNull
                                                        @NotNull UIApplication application,
                                                        @NotNull
                                                        @NotNull NSSet<? extends UISceneSession> sceneSessions)
        Called when the system, due to a user interaction or a request from the application itself, removes one or more representation from the -[UIApplication openSessions] set If sessions are discarded while the application is not running, this method is called shortly after the application's next launch. API-Since: 13.0
      • applicationShouldRestoreSecureApplicationState

        default boolean applicationShouldRestoreSecureApplicationState​(@NotNull
                                                                       @NotNull UIApplication application,
                                                                       @NotNull
                                                                       @NotNull NSCoder coder)
        API-Since: 13.2
      • applicationShouldSaveSecureApplicationState

        default boolean applicationShouldSaveSecureApplicationState​(@NotNull
                                                                    @NotNull UIApplication application,
                                                                    @NotNull
                                                                    @NotNull NSCoder coder)
        API-Since: 13.2
      • applicationHandlerForIntent

        @Nullable
        default @Nullable java.lang.Object applicationHandlerForIntent​(@NotNull
                                                                       @NotNull UIApplication application,
                                                                       @NotNull
                                                                       @NotNull INIntent intent)
        API-Since: 14.0
      • applicationShouldAutomaticallyLocalizeKeyCommands

        default boolean applicationShouldAutomaticallyLocalizeKeyCommands​(@NotNull
                                                                          @NotNull UIApplication application)
        UIKeyCommand system-wide keyboard shortcut localization support This method will be called during application launch. Return NO if the receiving delegate object wishes to opt-out of system-wide keyboard shortcut localization for all application-supplied UIKeyCommands. Return YES by default for apps linked against 15.0 and later SDK. API-Since: 15.0