Class UIApplication

All Implemented Interfaces:
NSObjectProtocol, UIActivityItemsConfigurationProviding, UIPasteConfigurationSupporting, UIResponderStandardEditActions, UIUserActivityRestoring, ObjCProtocol

public class UIApplication
extends UIResponder
  • Constructor Details

    • UIApplication

      public UIApplication()
    • UIApplication

      protected UIApplication​(NSObject.Handle h, long handle)
    • UIApplication

      protected UIApplication​(NSObject.SkipInit skipInit)
  • Method Details

    • getSharedApplication

      public static UIApplication getSharedApplication()
    • getDelegate

      public UIApplicationDelegate getDelegate()
    • setDelegate

      public void setDelegate​(UIApplicationDelegate v)
    • isIgnoringInteractionEvents

      @Deprecated public boolean isIgnoringInteractionEvents()
      Deprecated.
      Deprecated in iOS 13.0. Use UIView's userInteractionEnabled property instead
    • isIdleTimerDisabled

      public boolean isIdleTimerDisabled()
    • setIdleTimerDisabled

      public void setIdleTimerDisabled​(boolean v)
    • getKeyWindow

      @Deprecated public UIWindow getKeyWindow()
      Deprecated.
      Deprecated in iOS 13.0. Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes
    • getWindows

      @Deprecated public NSArray<UIWindow> getWindows()
      Deprecated.
      Deprecated in iOS 15.0. Use UIWindowScene.windows on a relevant window scene instead
    • isNetworkActivityIndicatorVisible

      @Deprecated public boolean isNetworkActivityIndicatorVisible()
      Deprecated.
      Deprecated in iOS 13.0. Provide a custom network activity UI in your app if desired.
    • setNetworkActivityIndicatorVisible

      @Deprecated public void setNetworkActivityIndicatorVisible​(boolean v)
      Deprecated.
      Deprecated in iOS 13.0. Provide a custom network activity UI in your app if desired.
    • getStatusBarStyle

      @Deprecated public UIStatusBarStyle getStatusBarStyle()
      Deprecated.
      Deprecated in iOS 13.0. Use the statusBarManager property of the window scene instead.
    • isStatusBarHidden

      @Deprecated public boolean isStatusBarHidden()
      Deprecated.
      Deprecated in iOS 13.0. Use the statusBarManager property of the window scene instead.
    • getStatusBarOrientation

      @Deprecated public UIInterfaceOrientation getStatusBarOrientation()
      Deprecated.
      Deprecated in iOS 13.0. Use the interfaceOrientation property of the window scene instead.
    • getStatusBarOrientationAnimationDuration

      @Deprecated public double getStatusBarOrientationAnimationDuration()
      Deprecated.
      Deprecated in iOS 13.0. Use viewWillTransitionToSize:withTransitionCoordinator: instead.
    • getStatusBarFrame

      @Deprecated public CGRect getStatusBarFrame()
      Deprecated.
      Deprecated in iOS 13.0. Use the statusBarManager property of the window scene instead.
    • getApplicationIconBadgeNumber

      public long getApplicationIconBadgeNumber()
    • setApplicationIconBadgeNumber

      public void setApplicationIconBadgeNumber​(long v)
    • supportsShakeToEdit

      public boolean supportsShakeToEdit()
    • setSupportsShakeToEdit

      public void setSupportsShakeToEdit​(boolean v)
    • getApplicationState

      public UIApplicationState getApplicationState()
    • getBackgroundTimeRemaining

      public double getBackgroundTimeRemaining()
    • getBackgroundRefreshStatus

      public UIBackgroundRefreshStatus getBackgroundRefreshStatus()
    • isProtectedDataAvailable

      public boolean isProtectedDataAvailable()
    • getUserInterfaceLayoutDirection

      public UIUserInterfaceLayoutDirection getUserInterfaceLayoutDirection()
    • getPreferredContentSizeCategory

      public String getPreferredContentSizeCategory()
    • getConnectedScenes

      public NSSet<UIScene> getConnectedScenes()
      Since:
      Available in iOS 13.0 and later.
    • getOpenSessions

      public NSSet<UISceneSession> getOpenSessions()
      Since:
      Available in iOS 13.0 and later.
    • supportsMultipleScenes

      public boolean supportsMultipleScenes()
      Since:
      Available in iOS 13.0 and later.
    • isRegisteredForRemoteNotifications

      public boolean isRegisteredForRemoteNotifications()
    • getScheduledLocalNotifications

      @Deprecated public NSArray<UILocalNotification> getScheduledLocalNotifications()
      Deprecated.
      Deprecated in iOS 10.0. Use UserNotifications Framework's -[UNUserNotificationCenter getPendingNotificationRequestsWithCompletionHandler:]
    • setScheduledLocalNotifications

      @Deprecated public void setScheduledLocalNotifications​(NSArray<UILocalNotification> v)
      Deprecated.
      Deprecated in iOS 10.0. Use UserNotifications Framework's -[UNUserNotificationCenter getPendingNotificationRequestsWithCompletionHandler:]
    • getCurrentUserNotificationSettings

      @Deprecated public UIUserNotificationSettings getCurrentUserNotificationSettings()
      Deprecated.
      Deprecated in iOS 10.0. Use UserNotifications Framework's -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] and -[UNUserNotificationCenter getNotificationCategoriesWithCompletionHandler:]
    • getShortcutItems

      public NSArray<UIApplicationShortcutItem> getShortcutItems()
      Since:
      Available in iOS 9.0 and later.
    • setShortcutItems

      public void setShortcutItems​(NSArray<UIApplicationShortcutItem> v)
      Since:
      Available in iOS 9.0 and later.
    • supportsAlternateIcons

      public boolean supportsAlternateIcons()
      Since:
      Available in iOS 10.3 and later.
    • getAlternateIconName

      public String getAlternateIconName()
      Since:
      Available in iOS 10.3 and later.
    • setStatusBarOrientation

      @Deprecated public void setStatusBarOrientation​(UIInterfaceOrientation v)
      Deprecated.
      Deprecated in iOS 9.0. Explicit setting of the status bar orientation is more limited in iOS 6.0 and later
    • setStatusBarStyle

      @Deprecated public void setStatusBarStyle​(UIStatusBarStyle v)
      Deprecated.
      Deprecated in iOS 9.0. Use -[UIViewController preferredStatusBarStyle]
    • setStatusBarHidden

      @Deprecated public void setStatusBarHidden​(boolean v)
      Deprecated.
      Deprecated in iOS 9.0. Use -[UIViewController prefersStatusBarHidden]
    • main

      public static <P extends UIApplication,​ D extends NSObject & UIApplicationDelegate> void main​(String[] args, Class<P> principalClass, Class<D> delegateClass)
    • ContentSizeCategoryDidChangeNotification

      public static NSString ContentSizeCategoryDidChangeNotification()
    • ContentSizeCategoryNewValueKey

      protected static NSString ContentSizeCategoryNewValueKey()
    • getInvalidBackgroundTask

      public static long getInvalidBackgroundTask()
    • getMinimumKeepAliveTimeout

      @Deprecated public static double getMinimumKeepAliveTimeout()
      Deprecated.
      Deprecated in iOS 13.0. Please use PushKit for VoIP applications.
    • getBackgroundFetchIntervalMinimum

      public static double getBackgroundFetchIntervalMinimum()
    • getBackgroundFetchIntervalNever

      public static double getBackgroundFetchIntervalNever()
    • DidEnterBackgroundNotification

      public static NSString DidEnterBackgroundNotification()
    • WillEnterForegroundNotification

      public static NSString WillEnterForegroundNotification()
    • DidFinishLaunchingNotification

      public static NSString DidFinishLaunchingNotification()
    • DidBecomeActiveNotification

      public static NSString DidBecomeActiveNotification()
    • WillResignActiveNotification

      public static NSString WillResignActiveNotification()
    • DidReceiveMemoryWarningNotification

      public static NSString DidReceiveMemoryWarningNotification()
    • WillTerminateNotification

      public static NSString WillTerminateNotification()
    • SignificantTimeChangeNotification

      public static NSString SignificantTimeChangeNotification()
    • WillChangeStatusBarOrientationNotification

      @Deprecated public static NSString WillChangeStatusBarOrientationNotification()
      Deprecated.
      Deprecated in iOS 13.0. Use viewWillTransitionToSize:withTransitionCoordinator: instead.
    • DidChangeStatusBarOrientationNotification

      @Deprecated public static NSString DidChangeStatusBarOrientationNotification()
      Deprecated.
      Deprecated in iOS 13.0. Use viewWillTransitionToSize:withTransitionCoordinator: instead.
    • StatusBarOrientationUserInfoKey

      @Deprecated protected static NSString StatusBarOrientationUserInfoKey()
      Deprecated.
      Deprecated in iOS 13.0. Use viewWillTransitionToSize:withTransitionCoordinator: instead.
    • WillChangeStatusBarFrameNotification

      @Deprecated public static NSString WillChangeStatusBarFrameNotification()
      Deprecated.
      Deprecated in iOS 13.0. Use viewWillTransitionToSize:withTransitionCoordinator: instead.
    • DidChangeStatusBarFrameNotification

      @Deprecated public static NSString DidChangeStatusBarFrameNotification()
      Deprecated.
      Deprecated in iOS 13.0. Use viewWillTransitionToSize:withTransitionCoordinator: instead.
    • StatusBarFrameUserInfoKey

      @Deprecated protected static NSString StatusBarFrameUserInfoKey()
      Deprecated.
      Deprecated in iOS 13.0. Use viewWillTransitionToSize:withTransitionCoordinator: instead.
    • BackgroundRefreshStatusDidChangeNotification

      public static NSString BackgroundRefreshStatusDidChangeNotification()
    • ProtectedDataWillBecomeUnavailableNotification

      public static NSString ProtectedDataWillBecomeUnavailableNotification()
    • ProtectedDataDidBecomeAvailableNotification

      public static NSString ProtectedDataDidBecomeAvailableNotification()
    • getOpenSettingsURLString

      public static String getOpenSettingsURLString()
    • getOpenNotificationSettingsURLString

      public static String getOpenNotificationSettingsURLString()
      Since:
      Available in iOS 15.4 and later.
    • UserDidTakeScreenshotNotification

      public static NSString UserDidTakeScreenshotNotification()
    • main

      protected static int main​(int argc, BytePtr.BytePtrPtr argv, String principalClassName, String delegateClassName)
    • beginIgnoringInteractionEvents

      @Deprecated public void beginIgnoringInteractionEvents()
      Deprecated.
      Deprecated in iOS 13.0. Use UIView's userInteractionEnabled property instead
    • endIgnoringInteractionEvents

      @Deprecated public void endIgnoringInteractionEvents()
      Deprecated.
      Deprecated in iOS 13.0. Use UIView's userInteractionEnabled property instead
    • openURL

      @Deprecated public boolean openURL​(NSURL url)
      Deprecated.
      Deprecated in iOS 10.0. Use openURL:options:completionHandler:
    • canOpenURL

      public boolean canOpenURL​(NSURL url)
    • openURL

      public void openURL​(NSURL url, UIApplicationOpenURLOptions options, VoidBooleanBlock completion)
      Since:
      Available in iOS 10.0 and later.
    • sendEvent

      public void sendEvent​(UIEvent event)
    • sendAction

      public boolean sendAction​(Selector action, NSObject target, NSObject sender, UIEvent event)
    • getSupportedInterfaceOrientations

      public UIInterfaceOrientationMask getSupportedInterfaceOrientations​(UIWindow window)
    • beginBackgroundTask

      public long beginBackgroundTask​(Runnable handler)
    • beginBackgroundTask

      public long beginBackgroundTask​(String taskName, Runnable handler)
    • endBackgroundTask

      public void endBackgroundTask​(long identifier)
    • setMinimumBackgroundFetchInterval

      @Deprecated public void setMinimumBackgroundFetchInterval​(double minimumBackgroundFetchInterval)
      Deprecated.
      Deprecated in iOS 13.0. Use a BGAppRefreshTask in the BackgroundTasks framework instead
    • requestSceneSessionActivation

      public void requestSceneSessionActivation​(UISceneSession sceneSession, NSUserActivity userActivity, UISceneActivationRequestOptions options, VoidBlock1<NSError> errorHandler)
      Since:
      Available in iOS 13.0 and later.
    • requestSceneSessionDestruction

      public void requestSceneSessionDestruction​(UISceneSession sceneSession, UISceneDestructionRequestOptions options, VoidBlock1<NSError> errorHandler)
      Since:
      Available in iOS 13.0 and later.
    • requestSceneSessionRefresh

      public void requestSceneSessionRefresh​(UISceneSession sceneSession)
      Since:
      Available in iOS 13.0 and later.
    • registerForRemoteNotifications

      public void registerForRemoteNotifications()
    • unregisterForRemoteNotifications

      public void unregisterForRemoteNotifications()
    • registerForRemoteNotificationTypes

      @Deprecated public void registerForRemoteNotificationTypes​(UIRemoteNotificationType types)
      Deprecated.
      Deprecated in iOS 8.0. Use -[UIApplication registerForRemoteNotifications] and UserNotifications Framework's -[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:]
    • getEnabledRemoteNotificationTypes

      @Deprecated public UIRemoteNotificationType getEnabledRemoteNotificationTypes()
      Deprecated.
      Deprecated in iOS 8.0. Use -[UIApplication isRegisteredForRemoteNotifications] and UserNotifications Framework's -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] to retrieve user-enabled remote notification and user notification settings
    • presentLocalNotificationNow

      @Deprecated public void presentLocalNotificationNow​(UILocalNotification notification)
      Deprecated.
      Deprecated in iOS 10.0. Use UserNotifications Framework's -[UNUserNotificationCenter addNotificationRequest:withCompletionHandler:]
    • scheduleLocalNotification

      @Deprecated public void scheduleLocalNotification​(UILocalNotification notification)
      Deprecated.
      Deprecated in iOS 10.0. Use UserNotifications Framework's -[UNUserNotificationCenter addNotificationRequest:withCompletionHandler:]
    • cancelLocalNotification

      @Deprecated public void cancelLocalNotification​(UILocalNotification notification)
      Deprecated.
      Deprecated in iOS 10.0. Use UserNotifications Framework's -[UNUserNotificationCenter removePendingNotificationRequestsWithIdentifiers:]
    • cancelAllLocalNotifications

      @Deprecated public void cancelAllLocalNotifications()
      Deprecated.
      Deprecated in iOS 10.0. Use UserNotifications Framework's -[UNUserNotificationCenter removeAllPendingNotificationRequests]
    • registerUserNotificationSettings

      @Deprecated public void registerUserNotificationSettings​(UIUserNotificationSettings notificationSettings)
      Deprecated.
      Deprecated in iOS 10.0. Use UserNotifications Framework's -[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:] and -[UNUserNotificationCenter setNotificationCategories:]
    • beginReceivingRemoteControlEvents

      public void beginReceivingRemoteControlEvents()
    • endReceivingRemoteControlEvents

      public void endReceivingRemoteControlEvents()
    • setNewsstandIconImage

      @Deprecated public void setNewsstandIconImage​(UIImage image)
      Deprecated.
      Deprecated in iOS 9.0. Newsstand apps now behave like normal apps on SpringBoard
    • setAlternateIcon

      public void setAlternateIcon​(String alternateIconName, VoidBlock1<NSError> completionHandler)
      Since:
      Available in iOS 10.3 and later.
    • extendStateRestoration

      public void extendStateRestoration()
    • completeStateRestoration

      public void completeStateRestoration()
    • ignoreSnapshotOnNextApplicationLaunch

      public void ignoreSnapshotOnNextApplicationLaunch()
    • registerObjectForStateRestoration

      public static void registerObjectForStateRestoration​(UIStateRestoring object, String restorationIdentifier)
    • setStatusBarOrientation

      @Deprecated public void setStatusBarOrientation​(UIInterfaceOrientation interfaceOrientation, boolean animated)
      Deprecated.
      Deprecated in iOS 9.0. Explicit setting of the status bar orientation is more limited in iOS 6.0 and later
    • setStatusBarStyle

      @Deprecated public void setStatusBarStyle​(UIStatusBarStyle statusBarStyle, boolean animated)
      Deprecated.
      Deprecated in iOS 9.0. Use -[UIViewController preferredStatusBarStyle]
    • setStatusBarHidden

      @Deprecated public void setStatusBarHidden​(boolean hidden, UIStatusBarAnimation animation)
      Deprecated.
      Deprecated in iOS 9.0. Use -[UIViewController prefersStatusBarHidden]
    • setKeepAliveTimeout

      @Deprecated public boolean setKeepAliveTimeout​(double timeout, Runnable keepAliveHandler)
      Deprecated.
      Deprecated in iOS 9.0. Please use PushKit for VoIP applications instead of calling this method
    • clearKeepAliveTimeout

      @Deprecated public void clearKeepAliveTimeout()
      Deprecated.
      Deprecated in iOS 9.0. Please use PushKit for VoIP applications instead of calling this method