Skip to content
Swift library for checking your IP address from ipify.org
Swift Ruby Objective-C
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Ipify.xcodeproj
Ipify
IpifyTests
.gitignore
.swift-version
.travis.yml
Ipify.podspec
LICENSE
README.md

README.md

Ipify

CI Status Carthage Compatible Version License Platform

Retrieve your public IP address from ipify's API service.

Usage

import Ipify

Ipify.getPublicIPAddress { result in
	switch result {
	case .success(let ip):
		print(ip) // "210.11.178.112"
		
	case .failure(let error):
		print(error.localizedDescription)
	}
}

Requirements

  • Swift 4
  • iOS 10+ / macOS 10.10+

Installation

CocoaPods

Ipify is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "Ipify"

Carthage

github "vincent-peng/swift-ipify"

Author

Vincent Peng, vincent@vincentpeng.me

Credit

Big thanks to Randall Degges for running and maintaining ipify!

License

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

You can’t perform that action at this time.