____ _ _ _ _ _ __
| _ \ ___ | (_) ___ ___ | | | | |/ /
| |_) / _ \| | |/ __/ _ \ | | | | ' /
| __/ (_) | | | (_| __/ | |_| | . \
|_| \___/|_|_|\___\___| \___/|_|\_\
_ _ _ _ _
| \ | | ___| |___ _____ _ __| | _(_)_ __ __ _
| \| |/ _ \ __\ \ /\ / / _ \| '__| |/ / | '_ \ / _` |
| |\ | __/ |_ \ V V / (_) | | | <| | | | | (_| |
|_| \_|\___|\__| \_/\_/ \___/|_| |_|\_\_|_| |_|\__, |
|___/
PoliceUK-Networking 的开发是为了将一个 API(https://data.police.uk/docs/)封装成一个 Swift 库,这个库可以在任何应用程序中使用。数据许可证:[开放政府许可证](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)
安装
PoliceUKNetworking 通过 CocoaPods 可用。要安装它,只需将以下行添加到您的 Podfile 中即可
pod 'PoliceUKNetworking', '~> 1.0.0'
要求
iOS 10.0+
示例
为了运行示例项目,克隆仓库,然后首先从 Example 目录运行 pod install
在其中您将找到如何使用库的所有示例
PoliceUKNetworking.getCrimeDBLaseUpdateDate { response, error in
print("------------------ getCrimeDBLaseUpdateDate ------------------")
if let response = response {
print("response: \(response)")
}
if let error = error {
print("error: \(error)")
}
}
func getCrimesByLocationForLatLong() {
PoliceUKNetworking.getCrimesByLocation(forLatitude:"52.629729", forLongitude: "-1.131592") { response, error in
print("------------------ getCrimesByLocation for Lat/Long ------------------")
if let response = response {
print("response: \(response)")
}
if let error = error {
print("error: \(error)")
}
}
}
此外,所有方法都有文档说明(点击任何方法左侧的选项 +)
作者
Deniss Kaibagarovs, [邮箱地址保护]
许可证
PoliceUKNetworking遵循MIT许可证。更多信息请参阅LICENSE文件。