william-weng/wwipaddress
- Get the external IP address of the mobile phone.
[Introduction - 簡介](https://swiftpackageindex.com/William-Weng)
- Get the external IP address of the mobile phone.
- 取得該手機對外的IP地址。
[WWIPAddress]
Installation with Swift Package Manager
dependencies: [
.package(url: "https://github.com/William-Weng/WWIPAddress.git", .upToNextMajor(from: "1.0.3"))
][Function - 可用函式](https://ezgif.com/video-to-webp)
|函式|功能| |-|-| |detail(service:timeout:result:)|取得對外IP相關資訊| |v4(service:timeout:result:)|取得對外IPv4地址| |information(_:timeout:result:)|反查IP相關資訊|
[Example](https://ezgif.com/video-to-webp)
import UIKit
import WWIPAddress
final class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
WWIPAddress.shared.v4() { result in
switch result {
case .failure(let error): print(error)
case .success(let ip): print(ip)
}
}
}
}Package Metadata
Repository: william-weng/wwipaddress
Default branch: main
README: README.md