Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何侦听appdelegate中的所有事件_Ios_Objective C - Fatal编程技术网

Ios 如何侦听appdelegate中的所有事件

Ios 如何侦听appdelegate中的所有事件,ios,objective-c,Ios,Objective C,我正在尝试使用自定义框架从appdelegate获取所有回调。但我想不出我该怎么做 我正在尝试获取从appdelegate返回的所有回调 您不能拥有所有回调,以下是您可以注册的UIApplication通知列表 @available(iOS 4.0, *) public static let UIApplicationDidEnterBackground: NSNotification.Name @available(iOS 4.0, *) public static let UIApplic

我正在尝试使用自定义框架从appdelegate获取所有回调。但我想不出我该怎么做


我正在尝试获取从appdelegate返回的所有回调

您不能拥有所有回调,以下是您可以注册的
UIApplication
通知列表

@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, set to YES if the file needs to be copied before use

// 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