Skip to content
This repository has been archived by the owner on Sep 8, 2019. It is now read-only.
/ IPKit Public archive

🌍 Easy-to-use Swift library for ipapi.co.

License

Notifications You must be signed in to change notification settings

agottardo/IPKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 IPKit

Travis Status GitHub GitHub release

IPKit is an easy-to-use framework for iOS/macOS that lets you interface seamlessly with ipapi.co, a commonly used service to obtain your IP address and some useful data related to it. With IPKit, you can go from this...

curl https://ipapi.co/8.8.8.8/json/
{
    "ip": "8.8.8.8",
    "city": "Mountain View",
    "region": "California",
    "region_code": "CA",
    "country": "US",
    "country_name": "United States",
    "continent_code": "NA",
    "in_eu": false,
    "postal": "94035",
    "latitude": 37.386,
    "longitude": -122.0838,
    "timezone": "America/Los_Angeles",
    "utc_offset": "-0800",
    "country_calling_code": "+1",
    "currency": "USD",
    "languages": "en-US,es-US,haw",
    "asn": "AS15169",
    "org": "Google LLC"
}

... to this Swift beauty:

IPAPI.shared.fetch { (response, error) in
    let ipAddress   = response.ip                   // "8.8.8.8"
    let city        = response.location.city        // "Mountain View"
    let coordinates = response.location.coordinates // CLLocationCoordinate2D(37.386, -122.0838)
}

About

🌍 Easy-to-use Swift library for ipapi.co.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published