TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Yourtion Guo.
HTTPDNS 库 Swift 实现,支持 DNSPod、AliYunDNS、Google 等(方便扩展)
在 Podfile
中添加:
platform :ios, '8.0'
pod 'HTTPDNS-Swift'
HTTPDNS.sharedInstance.getRecord("qq.com", callback: { (result) -> Void in
print("Async QQ.com", result)
})
print("Sync baidu.com", HTTPDNS.sharedInstance.getRecordSync("baidu.com"))
HTTPDNS.sharedInstance.cleanCache()
默认为 DNSPod 服务。
切换到 AliYun HTTPDNS,Key
为阿里云的 account id
HTTPDNS.sharedInstance.switchProvider(.AliYun, key: "100000")
切换到 DNSPod HTTPDNS,Key
为 nil
HTTPDNS.sharedInstance.switchProvider(.DNSPod, key: nil)
切换到 Google DNS-over-HTTP,Key
为 nil
HTTPDNS.sharedInstance.switchProvider(.Google, key: nil)