LocationManager的区域 [英] Region for LocationManager

查看:93
本文介绍了LocationManager的区域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个区域,以告诉我的位置管理器我关心的信标.我已经使用估算应用程序为我的信标生成了唯一的UUID.但是,我不断收到此错误,但找不到解决方法.你能帮我解决吗.我已在下面附上了屏幕截图.

I'm trying to create a region in order to tell my Location Manager which beacon I care about. I have generated a unique UUID for my beacon using the estimate app. However, I keep getting this error which I can't find a solution to. Could you please help me solve it. I have attached a screenshot below.

这是书面代码:

let region = CLBeaconRegion(proximityUUID: NSUUID(UUIDString: "79A60506-EC33-44A4-AB5D-304816FEC4E2"), identifier: "Estimotes")

这是错误:

init(UUIDString :)'已重命名为'init(uuidString:)'

init(UUIDString:)' has been renamed to 'init(uuidString:)'

推荐答案

在Swift 3.0中,"uuidString"中的"UUIDString"已更改.在您的信标的唯一UUID之后,您必须插入"as!UUID".

In Swift 3.0, "UUIDString" is changed in "uuidString". After the unique UUID for your beacon, you have to insert "as! UUID".

因此,您必须像这样更改租赁条件:

So, you have to change your let like this:

let region = CLBeaconRegion(proximityUUID: NSUUID(uuidString: "79A60506-EC33-44A4-AB5D-304816FEC4E2") as! UUID, identifier: "Estimotes")

这篇关于LocationManager的区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆