APPublicIP icon indicating copy to clipboard operation
APPublicIP copied to clipboard

Swift library to get the device's current public IP Address. Based on https://www.ipify.org/

APPublicIP

Get the device's current public IP Address. Based on https://www.ipify.org/ (unlimited requests for free)

One shot

let ipChecker = APPublicIP();
ipChecker.getCurrentIP { (ip) -> Void in
        println(ip)
}

Listen to any IP Address change.

let ipChecker = APPublicIP();
ipChecker.checkForCurrentIP({ (ip) -> Void in
        println(ip)
}, interval: 0.5.second)

Installation

As for now please clone the repository and drag the source folder into your project to use APPublicIP

This project uses https://github.com/radex/SwiftyTimer from Radek Pietruszewski

License

APPublicIP is available under the MIT license. See the LICENSE file for more info.