#import "ViewController.h"

#import <CoreLocation/CoreLocation.h>

@interface ViewController ()<CLLocationManagerDelegate>

@property(nonatomic,strong)CLLocationManager *manager;

@end

@implementation ViewController

-(CLLocationManager*)manager

{

if (_manager==nil) {

_manager=[[CLLocationManager alloc]init];

}

return _manager;

}

- (void)viewDidLoad {

[super viewDidLoad];

self.manager.delegate=self;

//判断ios7 或者8

if([[UIDevice currentDevice].systemVersion doubleValue]>8.0)

{

//[self.manager requestWhenInUseAuthorization];

[self.manager requestAlwaysAuthorization];

}

//创建中心点

CLLocationCoordinate2D center=CLLocationCoordinate2DMake(40.058501, 116.304171);

//确定区域

CLCircularRegion *circluar=[[CLCircularRegion alloc]initWithCenter:center radius:500 identifier:@"软件科技园!!"];

[self.manager startMonitoringForRegion:circluar];

}

-(void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region

{

NSLog(@"进入坚挺趋于调用");

}

-(void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region

{

NSLog(@"离开监听区域时调用");

}

@end

ios 区域检测 使用coreLocation的更多相关文章

  1. iOS开发拓展篇—CoreLocation地理编码

    iOS开发拓展篇—CoreLocation地理编码 一.简单说明 CLGeocoder:地理编码器,其中Geo是地理的英文单词Geography的简写. 1.使用CLGeocoder可以完成“地理编码 ...

  2. iOS开发检测是否开启定位、是否允许消息推送等权限

    1.iOS开发检测是否开启定位: 需要导入: #import <CoreLocation/CoreLocation.h> 代码如下: + (void)openLocationService ...

  3. iOS开发拓展篇—CoreLocation简单介绍

    iOS开发拓展篇—CoreLocation简单介绍 一.简介 1.在移动互联网时代,移动app能解决用户的很多生活琐事,比如 (1)导航:去任意陌生的地方 (2)周边:找餐馆.找酒店.找银行.找电影院 ...

  4. iOS开发拓展篇—CoreLocation定位服务

    iOS开发拓展篇—CoreLocation定位服务 一.简单说明 1.CLLocationManager CLLocationManager的常用操作和属性 开始用户定位- (void)startUp ...

  5. ios晃动检测

    ios晃动检测  第一种 1.在AppDelegate.h中进行如下设置: - (BOOL)application:(UIApplication *)application didFinishLaun ...

  6. 区域检测算法-MSERs

    区域检测算法-MSERs:最大稳定极值区域 参考书籍——<图像局部不变性特征与描述>王永明.王贵锦著 MSER最大极值稳定区域的提取步骤:1.像素点排序   2.极值区域生成   3.稳定 ...

  7. ocr 文字区域检测及识别

    ocr 文字区域检测及识别 # coding=utf- from PIL import Image, ImageFilter, ImageEnhance from skimage.filters im ...

  8. iOS 覆盖率检测原理与增量代码测试覆盖率工具实现

    背景 对苹果开发者而言,由于平台审核周期较长,客户端代码导致的线上问题影响时间往往比较久.如果在开发.测试阶段能够提前暴露问题,就有助于避免线上事故的发生.代码覆盖率检测正是帮助开发.测试同学提前发现 ...

  9. iOS开发 检测版本更新

    iOS开发 检测版本更新的实现 苹果给了我们一个接口,能根据应用id请求一些关于应用的信息.我们可以根据返回的信息,来判断版本是否和应用的版本一致,如果不一致,那么就出现新的版本了.这时,就需要向用户 ...

随机推荐

  1. C#之Windows消息处理

    public enum WindowsMessage:int { /// <summary> /// /// </summary> WM_NULL = 0x0000, /// ...

  2. FFPlay-noConsole-ver-20160409-snapshot

    ESC 退出 0 进度条开关 1 屏幕原始大小 2 屏幕1/2大小 3 屏幕1/3大小 4 屏幕1/4大小 S 下一帧 [ -2秒 ] +2秒 ; -1秒 ' +1秒 下一个帧 -> -5秒 F ...

  3. webpack学习笔记一

    主要参考: https://blog.madewithlove.be/post/webpack-your-bags/ 起因: 作为运维狗, 对前端一窍不通但心向往之, 最近做一个Dashboard, ...

  4. java基础学习04(数组与方法)

    数组与方法 一.完成的目标 1. 掌握数组的定义.使用方法.引用传递 2. 掌握方法及其方法的重载 3. 使用方法接收和返回一个数组 4. java新特性对数组的操作支持 二.数组的定义和使用 数组是 ...

  5. LeetCode 453 Minimum Moves to Equal Array Elements

    Problem: Given a non-empty integer array of size n, find the minimum number of moves required to mak ...

  6. 手动关闭searchDisplayControlelr

    两行代码搞定 [searchBar endEditing:YES]; [searchDisplayControllersetActive:NO];

  7. [Android Pro] Android 进程级别 和 oom_adj对应关系

    一 : 前台进程 (Active Process): oom_adj为0. 前台进程包括 : 1 : 活动 正在前台接收用户输入 2:活动.服务与广播接收器正在执行一个onReceive事件的处理函数 ...

  8. vs c# int & int32

    在vs c#中,int就等价于int32, 所以通常也是使用int32 当在统计总数时,最好使用int32,int16数值范围太小,如果超出,就会变成随机数.

  9. 3dmax导出3ds具有过多要导出的面超过64k解决方法

    参考:http://blog.sina.com.cn/s/blog_7a71dd090100w3r0.html 修改器->网格编辑->ProOptimizer 选中对象, 原始模型 顶点数 ...

  10. clustershell

    .安装 yum install clustershell .配置ssh无密码登录 .配置/etc/hosts 在hosts中文件中将ip和主机名对应起来,使用比较方便 .配置关键文件 clusters ...