Parrot 0.0.6

Parrot 0.0.6

测试已测试
Lang语言 SwiftSwift
许可证 MIT
发布最新发布2017年11月
SwiftSwift版本4.0
SPM支持SPM

Gonzalo Nunez维护。



Parrot 0.0.6

Carrot

Platforms
Pods version
Carthage compatible
Build Status

Parrot是一个(非常)小的Swift框架,它可以帮助将iOS设备作为iBeacon进行广播,并能够监控/测量iBeacon的近距离。

🎙广播iBeacon信号

Parrot允许您通过以下方式将设备转换为iBeacon:将您的设备转换为iBeacon

let uuid = UUID(string: "E621E1F8-C36C-495A-93FC-0C247A3E6E5F")!
let beaconAdvertiser = BeaconAdvertiser(uuid: uuid, identifier: "com.myCompany.BeaconIdentifier", params: .none)
beaconAdvertiser.startAdvertising { advertiser, state in 
  print("State: \(state) for \(advertiser)")
}

🔊确定与iBeacon的邻近距离

Parrot还允许您通过以下方式轻易地确定与iBeacon的邻近距离

let uuid = UUID(string: "E621E1F8-C36C-495A-93FC-0C247A3E6E5F")!
let beaconMonitor = BeaconMonitor(uuid: uuid, identifier: "com.myCompany.BeaconIdentifier", params: .none)
beaconMonitor.startMonitoring(
  onProximityUpdate: { monitor, proximity in
    print("Proximity: \(proximity) for \(monitor)")
  },
  onError: { error in
    print("Error occured: \(error)")       
  }
)

🛠安装

Parrot可通过CocoaPods获取。要安装它,只需将以下行添加到您的Podfile中

pod "Parrot"

Parrot也可通过Carthage获取。将其添加到您的Cartfile中

github "carrot-ar/Parrot"

🥕更多

要查看我们如何使用Parrot,请查看carrot-ios!