芒果iOiOS开发之CLAuthorizationStatus枚举

CLAuthorizationStatus枚举是定位的时候关于授权状态的一个枚举:

/*
 *  CLAuthorizationStatus
 *  
 *  Discussion:
 *      Represents the current authorization state of the application.
 *      
 */
typedef NS_ENUM(int, CLAuthorizationStatus) {
	// User has not yet made a choice with regards to this application
	kCLAuthorizationStatusNotDetermined = 0,

	// This application is not authorized to use location services.  Due
	// to active restrictions on location services, the user cannot change
	// this status, and may not have personally denied authorization
	kCLAuthorizationStatusRestricted,

	// User has explicitly denied authorization for this application, or
	// location services are disabled in Settings.
	kCLAuthorizationStatusDenied,

	// User has granted authorization to use their location at any time,
	// including monitoring for regions, visits, or significant location changes.
	kCLAuthorizationStatusAuthorizedAlways NS_ENUM_AVAILABLE(NA, 8_0),

	// User has granted authorization to use their location only when your app
	// is visible to them (it will be made visible to them if you continue to
	// receive location updates while in the background).  Authorization to use
	// launch APIs has not been granted.
	kCLAuthorizationStatusAuthorizedWhenInUse NS_ENUM_AVAILABLE(NA, 8_0),

	// This value is deprecated, but was equivalent to the new -Always value.
	kCLAuthorizationStatusAuthorized NS_ENUM_DEPRECATED(10_6, NA, 2_0, 8_0, "Use kCLAuthorizationStatusAuthorizedAlways") __TVOS_PROHIBITED __WATCHOS_PROHIBITED = kCLAuthorizationStatusAuthorizedAlways
};

一、第一个枚举值: kCLAuthorizationStatusNotDetermined 的意思是: 定位服务 授权状态是用户没有决定是否使用定位服务。

二、第二个枚举值:kCLAuthorizationStatusRestricted的意思是:定位服务授权状态是受限制的。可能是由于活动限制定位服务,用户不能改变。这个状态可能不是用户拒绝的定位服务。

三、第三个枚举值:kCLAuthorizationStatusDenied的意思是:定位服务授权状态已经被用户明确禁止,或者在设置里的定位服务中关闭。

四、第四个枚举值:kCLAuthorizationStatusAuthorizedAlways的意思是:定位服务授权状态已经被用户允许在任何状态下获取位置信息。包括监测区域、访问区域、或者在有显著的位置变化的时候。

五、第五个枚举值:kCLAuthorizationStatusAuthorizedWhenInUse的意思是:定位服务授权状态仅被允许在使用应用程序的时候。

六、第六个枚举值:kCLAuthorizationStatusAuthorized的意思是:这个枚举值已经被废弃了。他相当于

kCLAuthorizationStatusAuthorizedAlways这个值。



















你可能感兴趣的:(iOS开发高级)