Skip to content

Latest commit

 

History

History
66 lines (46 loc) · 1.39 KB

File metadata and controls

66 lines (46 loc) · 1.39 KB

======================================

Carthage compatible

About IPAPI

ip-api.com offers a web service to resolve a requesting client's location based on the client's IP address.

Usage

Here's an example
IPAPI.location(NSURLSession.sharedSession())
    .observeOn(MainScheduler.instance)
    .subscribeNext { (geoData: IPGeoData?) in
        // do something with geoData
        // geoData.ispName => ISP Name
        // geoData.ipAddress => IP Address
        // geoData.city => City
        // geoData.region => Region
        // geoData.zipCode => Zip Code
        self.updateLocation(geoData.lat, geoData.lng)
    }
    .addDisposableTo(disposeBag)
    

Requirements

  • Xcode 7+

  • Swift 2.3

  • iOS 8.0+

Installation

IPAPI has an external dependency on RxSwift

These are currently the supported options:

Add this to Cartfile

github "agoodman/IPAPI"
$ carthage update

References