哪种activityType更适合使用?

时间:2016-01-01 06:45:50

标签: cllocationmanager cllocation

我有一个可用于驾驶,滑雪,步行,火车等的应用程序。应该使用哪个activityTypeCLActivityTypeAutomotiveNavigation会涵盖所有用例吗?

代码是为了迎合iOS 8和9 - (对于应该删除respondsToSelector有疑问):

if ([locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)])
{
    [locationManager requestWhenInUseAuthorization];
    locationManager.activityType = CLActivityTypeAutomotiveNavigation;
}

if ([locationManager respondsToSelector:@selector(pausesLocationUpdatesAutomatically)])
{
    locationManager.pausesLocationUpdatesAutomatically = YES;
}

0 个答案:

没有答案