XLsn0wLocation 一键定位您当前地理位置 CocoaPods组件

- (void)addXLsn0wLocation {

[[XLsn0wLocation defaultLocation] startLocationAddress:^(BOOL isSuccess, XLsn0wLocationModel *locationModel) {

if (isSuccess) {

NSDictionary *locationInfo = locationModel.locatedAddress;

NSLog(@"%@", [locationInfo objectForKey:@"Country"]);

NSLog(@"%@", [locationInfo objectForKey:@"State"]);

NSLog(@"%@", [locationInfo objectForKey:@"City"]);

NSLog(@"%@", [locationInfo objectForKey:@"SubLocality"]);

NSLog(@"%@", [locationInfo objectForKey:@"Street"]);

_location.text = [NSString stringWithFormat:@"%@ %@ %@", [locationInfo objectForKey:@"Country"], [locationInfo objectForKey:@"State"], [locationInfo objectForKey:@"City"]];

//            NSLog(@"%@", [dic objectForKey:@"CountryCode"]);

//            NSLog(@"%@", [dic objectForKey:@"FormattedAddressLines"]);

//            NSLog(@"%@", [dic objectForKey:@"Name"]);

//            NSLog(@"%@", [dic objectForKey:@"Thoroughfare"]);

}else {

NSLog(@"定位失败");

}

}];

}

我的Github->https://github.com/XLsn0w

我的新浪微博-> @XLsn0w

我的微信公众号-> Cydiapple

XLsn0wLocation 一键定位您当前地理位置 CocoaPods组件_第1张图片
XLsn0wLocation 一键定位您当前地理位置 CocoaPods组件_第2张图片
XLsn0wLocation 一键定位您当前地理位置 CocoaPods组件_第3张图片

你可能感兴趣的:(XLsn0wLocation 一键定位您当前地理位置 CocoaPods组件)