Skip to content

William-Weng/WWIPAddress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WWIPAddress

Swift-5.7 iOS-15.0 TAG Swift Package Manager-SUCCESS LICENSE

  • Get the external IP address of the mobile phone.
  • 取得該手機對外的IP地址。

WWIPAddress

dependencies: [
    .package(url: "https://github.com/William-Weng/WWIPAddress.git", .upToNextMajor(from: "1.0.3"))
]
函式 功能
detail(service:timeout:result:) 取得對外IP相關資訊
v4(service:timeout:result:) 取得對外IPv4地址
information(_:timeout:result:) 反查IP相關資訊
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)
            }
        }
    }
}

About

Get the external IP address of the mobile phone.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages