import Foundation
import UIKit
import _SwiftUIKitOverlayShims
//
// UIApplication.h
// UIKit
//
// Copyright (c) 2005-2017 Apple Inc. All rights reserved.
//
public enum UIStatusBarStyle : Int {
case default
// Dark content, for use on light backgrounds
@available(iOS 7.0, *)
case lightContent // Light content, for use on dark backgrounds
}
public enum UIStatusBarAnimation : Int {
case none
@available(iOS 3.2, *)
case fade
@available(iOS 3.2, *)
case slide
}
// Note that UIInterfaceOrientationLandscapeLeft is equal to UIDeviceOrientationLandscapeRight (and vice versa).
// This is because rotating the device to the left requires rotating the content to the right.
public enum UIInterfaceOrientation : Int {
case unknown
case portrait
case portraitUpsideDown
case landscapeLeft
case landscapeRight
}
extension UIInterfaceOrientation {
public var isLandscape: Bool { get }
public var isPortrait: Bool { get }
}
extension NSExceptionName {
/* This exception is raised if supportedInterfaceOrientations returns 0, or if preferredInterfaceOrientationForPresentation
returns an orientation that is not supported.
*/
@available(iOS 6.0, *)
public static let UIApplicationInvalidInterfaceOrientationException: NSExceptionName
}
public struct UIInterfaceOrientationMask : OptionSet {
public init(rawValue: UInt)
public static var portrait: UIInterfaceOrientationMask { get }
public static var landscapeLeft: UIInterfaceOrientationMask { get }
public static var landscapeRight: UIInterfaceOrientationMask { get }
public static var portraitUpsideDown: UIInterfaceOrientationMask { get }
public static var landscape: UIInterfaceOrientationMask { get }
public static var all: UIInterfaceOrientationMask { get }
public static var allButUpsideDown: UIInterfaceOrientationMask { get }
}
public func UIInterfaceOrientationIsPortrait(_ orientation: UIInterfaceOrientation) -> Bool
public func UIInterfaceOrientationIsLandscape(_ orientation: UIInterfaceOrientation) -> Bool
@available(iOS, introduced: 3.0, deprecated: 8.0, message: “Use UserNotifications Framework’s UNAuthorizationOptions for user notifications and registerForRemoteNotifications for receiving remote notifications instead.”)
public struct UIRemoteNotificationType : OptionSet {
public init(rawValue: UInt)
public static var badge: UIRemoteNotificationType { get }
public static var sound: UIRemoteNotificationType { get }
public static var alert: UIRemoteNotificationType { get }
public static var newsstandContentAvailability: UIRemoteNotificationType { get }
}
@available(iOS 7.0, *)
public enum UIBackgroundFetchResult : UInt {
case newData
case noData
case failed
}
@available(iOS 7.0, *)
public enum UIBackgroundRefreshStatus : Int {
case restricted //< unavailable on this system due to device configuration; the user cannot enable the feature
case denied //< explicitly disabled by the user for this application
case available //< enabled for this application
}
@available(iOS 4.0, *)
public enum UIApplicationState : Int {
case active
case inactive
case background
}
public typealias UIBackgroundTaskIdentifier = Int
@available(iOS 4.0, *)
public let UIBackgroundTaskInvalid: UIBackgroundTaskIdentifier
@available(iOS 4.0, *)
public let UIMinimumKeepAliveTimeout: TimeInterval
@available(iOS 7.0, *)
public let UIApplicationBackgroundFetchIntervalMinimum: TimeInterval
@available(iOS 7.0, *)
public let UIApplicationBackgroundFetchIntervalNever: TimeInterval
@available(iOS 2.0, *)
open class UIApplication : UIResponder {
open class var shared: UIApplication { get }
unowned(unsafe) open var delegate: UIApplicationDelegate?
open func beginIgnoringInteractionEvents() // nested. set should be set during animations & transitions to ignore touch and other events
open func endIgnoringInteractionEvents()
open var isIgnoringInteractionEvents: Bool { get } // returns YES if we are at least one deep in ignoring events
// returns YES if we are at least one deep in ignoring events
open var isIdleTimerDisabled: Bool // default is NO
@available(iOS, introduced: 2.0, deprecated: 10.0, message: “Please use openURL:options:completionHandler: instead”)
open func openURL(_ url: URL) -> Bool
@available(iOS 3.0, *)
open func canOpenURL(_ url: URL) -> Bool
// Options are specified in the section below for openURL options. An empty options dictionary will result in the same
// behavior as the older openURL call, aside from the fact that this is asynchronous and calls the completion handler rather
// than returning a result.
// The completion handler is called on the main queue.
@available(iOS 10.0, *)
open func open(_ url: URL, options: [String : Any] = [:], completionHandler completion: ((Bool) -> Swift.Void)? = nil)
open func sendEvent(_ event: UIEvent)
open var keyWindow: UIWindow? { get }
open var windows: [UIWindow] { get }
open func sendAction(_ action: Selector, to target: Any?, from sender: Any?, for event: UIEvent?) -> Bool
open var isNetworkActivityIndicatorVisible: Bool // showing network spinning gear in status bar. default is NO
open var statusBarStyle: UIStatusBarStyle { get } // default is UIStatusBarStyleDefault
open var isStatusBarHidden: Bool { get }
open var statusBarOrientation: UIInterfaceOrientation { get }
// The system only calls this method if the application delegate has not
// implemented the delegate equivalent. It returns the orientations specified by
// the application’s info.plist. If no supported interface orientations were
// specified it will return UIInterfaceOrientationMaskAll on an iPad and
// UIInterfaceOrientationMaskAllButUpsideDown on a phone. The return value
// should be one of the UIInterfaceOrientationMask values which indicates the
// orientations supported by this application.
@available(iOS 6.0, *)
open func supportedInterfaceOrientations(for window: UIWindow?) -> UIInterfaceOrientationMask
open var statusBarOrientationAnimationDuration: TimeInterval { get } // Returns the animation duration for the status bar during a 90 degree orientation change. It should be doubled for a 180 degree orientation change.
open var statusBarFrame: CGRect { get } // returns CGRectZero if the status bar is hidden
open var applicationIconBadgeNumber: Int // set to 0 to hide. default is 0. In iOS 8.0 and later, your application must register for user notifications using -[UIApplication registerUserNotificationSettings:] before being able to set the icon badge.
@available(iOS 3.0, *)
open var applicationSupportsShakeToEdit: Bool
@available(iOS 4.0, *)
open var applicationState: UIApplicationState { get }
@available(iOS 4.0, *)
open var backgroundTimeRemaining: TimeInterval { get }
@available(iOS 4.0, *)
open func beginBackgroundTask(expirationHandler handler: (() -> Swift.Void)? = nil) -> UIBackgroundTaskIdentifier
@available(iOS 7.0, *)
open func beginBackgroundTask(withName taskName: String?, expirationHandler handler: (() -> Swift.Void)? = nil) -> UIBackgroundTaskIdentifier
@available(iOS 4.0, *)
open func endBackgroundTask(_ identifier: UIBackgroundTaskIdentifier)
/*! The system guarantees that it will not wake up your application for a background fetch more
frequently than the interval provided. Set to UIApplicationBackgroundFetchIntervalMinimum to be
woken as frequently as the system desires, or to UIApplicationBackgroundFetchIntervalNever (the
default) to never be woken for a background fetch.
This setter will have no effect unless your application has the “fetch”
UIBackgroundMode. See the UIApplicationDelegate method
application:performFetchWithCompletionHandler:
for more. */
@available(iOS 7.0, *)
open func setMinimumBackgroundFetchInterval(_ minimumBackgroundFetchInterval: TimeInterval)
/*! When background refresh is available for an application, it may launched or resumed in the background to handle significant
location changes, remote notifications, background fetches, etc. Observe UIApplicationBackgroundRefreshStatusDidChangeNotification to
be notified of changes. */
@available(iOS 7.0, *)
open var backgroundRefreshStatus: UIBackgroundRefreshStatus { get }
@available(iOS 4.0, *)
open var isProtectedDataAvailable: Bool { get }
@available(iOS 5.0, *)
open var userInterfaceLayoutDirection: UIUserInterfaceLayoutDirection { get }
// Return the size category
@available(iOS 7.0, *)
open var preferredContentSizeCategory: UIContentSizeCategory { get }
}
extension UIApplication {
// Calling this will result in either application:didRegisterForRemoteNotificationsWithDeviceToken: or application:didFailToRegisterForRemoteNotificationsWithError: to be called on the application delegate. Note: these callbacks will be made only if the application has successfully registered for user notifications with registerUserNotificationSettings:, or if it is enabled for Background App Refresh.
@available(iOS 8.0, *)
open func registerForRemoteNotifications()
@available(iOS 3.0, *)
open func unregisterForRemoteNotifications()
// Returns YES if the application is currently registered for remote notifications, taking into account any systemwide settings; doesn’t relate to connectivity.
@available(iOS 8.0, *)
open var isRegisteredForRemoteNotifications: Bool { get }
@available(iOS, introduced: 3.0, deprecated: 8.0, message: “Use -[UIApplication registerForRemoteNotifications] and UserNotifications Framework’s -[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:]”)
open func registerForRemoteNotifications(matching types: UIRemoteNotificationType)
// Returns the enabled types, also taking into account any systemwide settings; doesn’t relate to connectivity.
@available(iOS, introduced: 3.0, deprecated: 8.0, message: “Use -[UIApplication isRegisteredForRemoteNotifications] and UserNotifications Framework’s -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] to retrieve user-enabled remote notification and user notification settings”)
open func enabledRemoteNotificationTypes() -> UIRemoteNotificationType
}
// In iOS 8.0 and later, your application must register for user notifications using -[UIApplication registerUserNotificationSettings:] before being able to schedule and present UILocalNotifications
extension UIApplication {
@available(iOS, introduced: 4.0, deprecated: 10.0, message: “Use UserNotifications Framework’s -[UNUserNotificationCenter addNotificationRequest:withCompletionHandler:]”)
open func presentLocalNotificationNow(_ notification: UILocalNotification)
@available(iOS, introduced: 4.0, deprecated: 10.0, message: “Use UserNotifications Framework’s -[UNUserNotificationCenter addNotificationRequest:withCompletionHandler:]”)
open func scheduleLocalNotification(_ notification: UILocalNotification) // copies notification
@available(iOS, introduced: 4.0, deprecated: 10.0, message: “Use UserNotifications Framework’s -[UNUserNotificationCenter removePendingNotificationRequestsWithIdentifiers:]”)
open func cancelLocalNotification(_ notification: UILocalNotification)
@available(iOS, introduced: 4.0, deprecated: 10.0, message: “Use UserNotifications Framework’s -[UNUserNotificationCenter removeAllPendingNotificationRequests]”)
open func cancelAllLocalNotifications()
@available(iOS, introduced: 4.0, deprecated: 10.0, message: “Use UserNotifications Framework’s -[UNUserNotificationCenter getPendingNotificationRequestsWithCompletionHandler:]”)
open var scheduledLocalNotifications: [UILocalNotification]?
}
extension UIApplication {
// Registering UIUserNotificationSettings more than once results in previous settings being overwritten.
@available(iOS, introduced: 8.0, deprecated: 10.0, message: “Use UserNotifications Framework’s -[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:] and -[UNUserNotificationCenter setNotificationCategories:]”)
open func registerUserNotificationSettings(_ notificationSettings: UIUserNotificationSettings)
// Returns the enabled user notification settings, also taking into account any systemwide settings.
@available(iOS, introduced: 8.0, deprecated: 10.0, message: “Use UserNotifications Framework’s -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] and -[UNUserNotificationCenter getNotificationCategoriesWithCompletionHandler:]”)
open var currentUserNotificationSettings: UIUserNotificationSettings? { get }
}
extension UIApplication {
@available(iOS 4.0, *)
open func beginReceivingRemoteControlEvents()
@available(iOS 4.0, *)
open func endReceivingRemoteControlEvents()
}
extension UIApplication {
@available(iOS, introduced: 5.0, deprecated: 9.0, message: “Newsstand apps now behave like normal apps on SpringBoard”)
open func setNewsstandIconImage(_ image: UIImage?)
}
extension UIApplication {
// Register shortcuts to display on the home screen, or retrieve currently registered shortcuts.
@available(iOS 9.0, *)
open var shortcutItems: [UIApplicationShortcutItem]?
}
extension UIApplication {
// If false, alternate icons are not supported for the current process.
@available(iOS 10.3, *)
open var supportsAlternateIcons: Bool { get }
// Pass nil
to use the primary application icon. The completion handler will be invoked asynchronously on an arbitrary background queue; be sure to dispatch back to the main queue before doing any further UI work.
@available(iOS 10.3, *)
open func setAlternateIconName(_ alternateIconName: String?, completionHandler: ((Error?) -> Swift.Void)? = nil)
// If nil
, the primary application icon is being used.
@available(iOS 10.3, *)
open var alternateIconName: String? { get }
}
extension UIApplication {
// These methods are used to inform the system that state restoration is occuring asynchronously after the application
// has processed its restoration archive on launch. In the even of a crash, the system will be able to detect that it may
// have been caused by a bad restoration archive and arrange to ignore it on a subsequent application launch.
@available(iOS 6.0, *)
open func extendStateRestoration()
@available(iOS 6.0, *)
open func completeStateRestoration()
// Indicate the application should not use the snapshot on next launch, even if there is a valid state restoration archive.
// This should only be called from methods invoked from State Preservation, else it is ignored.
@available(iOS 7.0, *)
open func ignoreSnapshotOnNextApplicationLaunch()
// Register non-View/ViewController objects for state restoration so other objects can reference them within state restoration archives.
// If the object implements encode/decode, those methods will be called during save/restore.
// Obj and identifier must not be nil, or will raise UIRestorationObjectRegistrationException.
// Objects do not need to be unregistered when they are deleted, the State Restoration system will notice and stop tracking the object.
@available(iOS 7.0, *)
open class func registerObject(forStateRestoration object: UIStateRestoring, restorationIdentifier: String)
}
public struct UIApplicationLaunchOptionsKey : RawRepresentable, Equatable, Hashable {
public init(_ rawValue: String)
public init(rawValue: String)
}
public protocol UIApplicationDelegate : NSObjectProtocol {
@available(iOS 2.0, *)
optional public func applicationDidFinishLaunching(_ application: UIApplication)
@available(iOS 6.0, *)
optional public func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool
@available(iOS 3.0, *)
optional public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool
@available(iOS 2.0, *)
optional public func applicationDidBecomeActive(_ application: UIApplication)
@available(iOS 2.0, *)
optional public func applicationWillResignActive(_ application: UIApplication)
@available(iOS, introduced: 2.0, deprecated: 9.0, message: “Please use application:openURL:options:”)
optional public func application(_ application: UIApplication, handleOpen url: URL) -> Bool
@available(iOS, introduced: 4.2, deprecated: 9.0, message: “Please use application:openURL:options:”)
optional public func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool
@available(iOS 9.0, *)
optional public func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool // no equiv. notification. return NO if the application can’t open for some reason
@available(iOS 2.0, *)
optional public func applicationDidReceiveMemoryWarning(_ application: UIApplication) // try to clean up as much memory as possible. next step is to terminate app
@available(iOS 2.0, *)
optional public func applicationWillTerminate(_ application: UIApplication)
@available(iOS 2.0, *)
optional public func applicationSignificantTimeChange(_ application: UIApplication) // midnight, carrier time update, daylight savings time change
@available(iOS 2.0, *)
optional public func application(_ application: UIApplication, willChangeStatusBarOrientation newStatusBarOrientation: UIInterfaceOrientation, duration: TimeInterval)
@available(iOS 2.0, *)
optional public func application(_ application: UIApplication, didChangeStatusBarOrientation oldStatusBarOrientation: UIInterfaceOrientation)
@available(iOS 2.0, *)
optional public func application(_ application: UIApplication, willChangeStatusBarFrame newStatusBarFrame: CGRect) // in screen coordinates
@available(iOS 2.0, *)
optional public func application(_ application: UIApplication, didChangeStatusBarFrame oldStatusBarFrame: CGRect)
// 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.
@available(iOS, introduced: 8.0, deprecated: 10.0, message: “Use UserNotifications Framework’s -[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:]”)
optional public func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings)
@available(iOS 3.0, *)
optional public func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
@available(iOS 3.0, *)
optional public func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error)
@available(iOS, introduced: 3.0, deprecated: 10.0, 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”)
optional public func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any])
@available(iOS, introduced: 4.0, deprecated: 10.0, message: “Use UserNotifications Framework’s -[UNUserNotificationCenterDelegate willPresentNotification:withCompletionHandler:] or -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]”)
optional public func application(_ application: UIApplication, didReceive notification: UILocalNotification)
// 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.
@available(iOS, introduced: 8.0, deprecated: 10.0, message: “Use UserNotifications Framework’s -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]”)
optional public func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, for notification: UILocalNotification, completionHandler: @escaping () -> Swift.Void)
@available(iOS, introduced: 9.0, deprecated: 10.0, message: “Use UserNotifications Framework’s -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]”)
optional public func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, forRemoteNotification userInfo: [AnyHashable : Any], withResponseInfo responseInfo: [AnyHashable : Any], completionHandler: @escaping () -> Swift.Void)
// 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.
@available(iOS, introduced: 8.0, deprecated: 10.0, message: “Use UserNotifications Framework’s -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]”)
optional public func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, forRemoteNotification userInfo: [AnyHashable : Any], completionHandler: @escaping () -> Swift.Void)
@available(iOS, introduced: 9.0, deprecated: 10.0, message: “Use UserNotifications Framework’s -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]”)
optional public func application(_ application: UIApplication, handleActionWithIdentifier identifier: String?, for notification: UILocalNotification, withResponseInfo responseInfo: [AnyHashable : Any], completionHandler: @escaping () -> Swift.Void)
/*! 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. !*/
@available(iOS 7.0, *)
optional public func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Swift.Void)
/// 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.
@available(iOS 7.0, *)
optional public func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Swift.Void)
// Called when the user activates your application by selecting a shortcut on the home screen,
// except when -application:willFinishLaunchingWithOptions: or -application:didFinishLaunchingWithOptions returns NO.
@available(iOS 9.0, *)
optional public func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Swift.Void)
// 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.
@available(iOS 7.0, *)
optional public func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Swift.Void)
@available(iOS 8.2, *)
optional public func application(_ application: UIApplication, handleWatchKitExtensionRequest userInfo: [AnyHashable : Any]?, reply: @escaping ([AnyHashable : Any]?) -> Swift.Void)
@available(iOS 9.0, *)
optional public func applicationShouldRequestHealthAuthorization(_ application: UIApplication)
@available(iOS 11.0, *)
optional public func application(_ application: UIApplication, handle intent: INIntent, completionHandler: @escaping (INIntentResponse) -> Swift.Void)
@available(iOS 4.0, *)
optional public func applicationDidEnterBackground(_ application: UIApplication)
@available(iOS 4.0, *)
optional public func applicationWillEnterForeground(_ application: UIApplication)
@available(iOS 4.0, *)
optional public func applicationProtectedDataWillBecomeUnavailable(_ application: UIApplication)
@available(iOS 4.0, *)
optional public func applicationProtectedDataDidBecomeAvailable(_ application: UIApplication)
@available(iOS 5.0, *)
optional public var window: UIWindow? { get set }
@available(iOS 6.0, *)
optional public func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask
// 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.
@available(iOS 8.0, *)
optional public func application(_ application: UIApplication, shouldAllowExtensionPointIdentifier extensionPointIdentifier: UIApplicationExtensionPointIdentifier) -> Bool
@available(iOS 6.0, *)
optional public func application(_ application: UIApplication, viewControllerWithRestorationIdentifierPath identifierComponents: [Any], coder: NSCoder) -> UIViewController?
@available(iOS 6.0, *)
optional public func application(_ application: UIApplication, shouldSaveApplicationState coder: NSCoder) -> Bool
@available(iOS 6.0, *)
optional public func application(_ application: UIApplication, shouldRestoreApplicationState coder: NSCoder) -> Bool
@available(iOS 6.0, *)
optional public func application(_ application: UIApplication, willEncodeRestorableStateWith coder: NSCoder)
@available(iOS 6.0, *)
optional public func application(_ application: UIApplication, didDecodeRestorableStateWith coder: NSCoder)
// 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.
@available(iOS 8.0, *)
optional public func application(_ application: UIApplication, willContinueUserActivityWithType userActivityType: String) -> Bool
// 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.
@available(iOS 8.0, *)
optional public func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Swift.Void) -> Bool
// If the user activity cannot be fetched after willContinueUserActivityWithType is called, this will be called on the main thread when implemented.
@available(iOS 8.0, *)
optional public func application(_ application: UIApplication, didFailToContinueUserActivityWithType userActivityType: String, error: Error)
// 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.
@available(iOS 8.0, *)
optional public func application(_ application: UIApplication, didUpdate userActivity: NSUserActivity)
// 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.
@available(iOS 10.0, *)
optional public func application(_ application: UIApplication, userDidAcceptCloudKitShareWith cloudKitShareMetadata: CKShareMetadata)
}
public struct UIApplicationOpenURLOptionsKey : RawRepresentable, Equatable, Hashable {
public init(_ rawValue: String)
public init(rawValue: String)
}
public struct UIApplicationExtensionPointIdentifier : RawRepresentable, Equatable, Hashable {
public init(_ rawValue: String)
public init(rawValue: String)
}
extension UIApplication {
// Explicit setting of the status bar orientation is more limited in iOS 6.0 and later.
@available(iOS, introduced: 2.0, deprecated: 9.0, message: “Explicit setting of the status bar orientation is more limited in iOS 6.0 and later”)
open func setStatusBarOrientation(_ interfaceOrientation: UIInterfaceOrientation, animated: Bool)
// Setting the statusBarStyle does nothing if your application is using the default UIViewController-based status bar system.
@available(iOS, introduced: 2.0, deprecated: 9.0, message: “Use -[UIViewController preferredStatusBarStyle]”)
open func setStatusBarStyle(_ statusBarStyle: UIStatusBarStyle, animated: Bool)
// Setting statusBarHidden does nothing if your application is using the default UIViewController-based status bar system.
@available(iOS, introduced: 3.2, deprecated: 9.0, message: “Use -[UIViewController prefersStatusBarHidden]”)
open func setStatusBarHidden(_ hidden: Bool, with animation: UIStatusBarAnimation)
@available(iOS, introduced: 4.0, deprecated: 9.0, message: “Please use PushKit for VoIP applications instead of calling this method”)
open func setKeepAliveTimeout(_ timeout: TimeInterval, handler keepAliveHandler: (() -> Swift.Void)? = nil) -> Bool
@available(iOS, introduced: 4.0, deprecated: 9.0, message: “Please use PushKit for VoIP applications instead of calling this method”)
open func clearKeepAliveTimeout()
}
// If nil is specified for principalClassName, the value for NSPrincipalClass from the Info.plist is used. If there is no
// NSPrincipalClass key specified, the UIApplication class is used. The delegate class will be instantiated using init.
public func UIApplicationMain( argc: Int32, argv: UnsafeMutablePointer<UnsafeMutablePointer
extension RunLoopMode {
public static let UITrackingRunLoopMode: RunLoopMode
}
extension NSNotification.Name {
@available(iOS 4.0, *)
public static let UIApplicationDidEnterBackground: NSNotification.Name
@available(iOS 4.0, *)
public static let UIApplicationWillEnterForeground: NSNotification.Name
public static let UIApplicationDidFinishLaunching: NSNotification.Name
public static let UIApplicationDidBecomeActive: NSNotification.Name
public static let UIApplicationWillResignActive: NSNotification.Name
public static let UIApplicationDidReceiveMemoryWarning: NSNotification.Name
public static let UIApplicationWillTerminate: NSNotification.Name
public static let UIApplicationSignificantTimeChange: NSNotification.Name
public static let UIApplicationWillChangeStatusBarOrientation: NSNotification.Name // userInfo contains NSNumber with new orientation
public static let UIApplicationDidChangeStatusBarOrientation: NSNotification.Name // userInfo contains NSNumber with old orientation
// userInfo dictionary key for status bar orientation
public static let UIApplicationWillChangeStatusBarFrame: NSNotification.Name // userInfo contains NSValue with new frame
public static let UIApplicationDidChangeStatusBarFrame: NSNotification.Name // userInfo contains NSValue with old frame
// userInfo dictionary key for status bar frame
@available(iOS 7.0, *)
public static let UIApplicationBackgroundRefreshStatusDidChange: NSNotification.Name
@available(iOS 4.0, *)
public static let UIApplicationProtectedDataWillBecomeUnavailable: NSNotification.Name
@available(iOS 4.0, *)
public static let UIApplicationProtectedDataDidBecomeAvailable: NSNotification.Name
// userInfo contains NSURL with launch URL
// userInfo contains NSString with launch app bundle ID
// userInfo contains NSDictionary with payload
// userInfo contains a UILocalNotification
// userInfo contains object with annotation property list
// app was launched in response to a CoreLocation event.
// userInfo contains an NSArray of NKAssetDownload identifiers
// userInfo contains an NSArray of CBCentralManager restore identifiers
// userInfo contains an NSArray of CBPeripheralManager restore identifiers
// userInfo contains the UIApplicationShortcutItem used to launch the app.
// Key in options dict passed to application:[will | did]FinishLaunchingWithOptions and info for UIApplicationDidFinishLaunchingNotification
// Sub-Dictionary present in launch options when user activity is present
// Key in user activity dictionary for the activity type
// The presence of this key indicates that the app was launched in order to handle a CloudKit sharing invitation. The value of this key is a CKShareMetadata object.
// userInfo contains NSURL with launch URL
// userInfo contains NSString with launch app bundle ID
// userInfo contains NSDictionary with payload
// userInfo contains a UILocalNotification
// userInfo contains object with annotation property list
// app was launched in response to a CoreLocation event.
// userInfo contains an NSArray of NKAssetDownload identifiers
// userInfo contains an NSArray of CBCentralManager restore identifiers
// userInfo contains an NSArray of CBPeripheralManager restore identifiers
// userInfo contains the UIApplicationShortcutItem used to launch the app.
// Key in options dict passed to application:[will | did]FinishLaunchingWithOptions and info for UIApplicationDidFinishLaunchingNotification
// Sub-Dictionary present in launch options when user activity is present
// Key in user activity dictionary for the activity type
// The presence of this key indicates that the app was launched in order to handle a CloudKit sharing invitation. The value of this key is a CKShareMetadata object.
// Keys for application:openURL:options:
// value is an NSString containing the bundle ID of the originating application
// value is a property-list typed object corresponding to what the originating application passed in UIDocumentInteractionController’s annotation property
// value is a bool NSNumber. Copy the file before use if this value is NO, or is not present.
// value is an NSString containing the bundle ID of the originating application
// value is a property-list typed object corresponding to what the originating application passed in UIDocumentInteractionController’s annotation property
// value is a bool NSNumber, set to YES if the file needs to be copied before use
// This notification is posted after the user takes a screenshot (for example by pressing both the home and lock screen buttons)
@available(iOS 7.0, *)
public static let UIApplicationUserDidTakeScreenshot: NSNotification.Name
}
public let UIApplicationStatusBarOrientationUserInfoKey: String
public let UIApplicationStatusBarFrameUserInfoKey: String
extension UIApplicationLaunchOptionsKey {
@available(iOS 3.0, *)
public static let url: UIApplicationLaunchOptionsKey
@available(iOS 3.0, *)
public static let sourceApplication: UIApplicationLaunchOptionsKey
@available(iOS 3.0, *)
public static let remoteNotification: UIApplicationLaunchOptionsKey
@available(iOS, introduced: 4.0, deprecated: 10.0, message: “Use UserNotifications Framework’s -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]”)
public static let localNotification: UIApplicationLaunchOptionsKey
@available(iOS 3.2, *)
public static let annotation: UIApplicationLaunchOptionsKey
@available(iOS 4.0, *)
public static let location: UIApplicationLaunchOptionsKey
@available(iOS 5.0, *)
public static let newsstandDownloads: UIApplicationLaunchOptionsKey
@available(iOS 7.0, *)
public static let bluetoothCentrals: UIApplicationLaunchOptionsKey
@available(iOS 7.0, *)
public static let bluetoothPeripherals: UIApplicationLaunchOptionsKey
@available(iOS 9.0, *)
public static let shortcutItem: UIApplicationLaunchOptionsKey
@available(iOS 8.0, *)
public static let userActivityDictionary: UIApplicationLaunchOptionsKey
@available(iOS 8.0, *)
public static let userActivityType: UIApplicationLaunchOptionsKey
@available(iOS 10.0, *)
public static let cloudKitShareMetadata: UIApplicationLaunchOptionsKey
}
@available(iOS 8.0, *)
public let UIApplicationOpenSettingsURLString: String
extension UIApplicationOpenURLOptionsKey {
@available(iOS 9.0, *)
public static let sourceApplication: UIApplicationOpenURLOptionsKey
@available(iOS 9.0, *)
public static let annotation: UIApplicationOpenURLOptionsKey
@available(iOS 9.0, *)
public static let openInPlace: UIApplicationOpenURLOptionsKey
}
extension UIApplicationExtensionPointIdentifier {
@available(iOS 8.0, *)
public static let keyboard: UIApplicationExtensionPointIdentifier
}
// Option for openURL:options:CompletionHandler: only open URL if it is a valid universal link with an application configured to open it
// If there is no application configured, or the user disabled using it to open the link, completion handler called with NO
@available(iOS 10.0, *)
public let UIApplicationOpenURLOptionUniversalLinksOnly: String