Get Updates By E-mail 

Article Written By:
Johann Dowa

Open Source Swift Library Providing A Clean Syntax For Easy Reachability Tracking

  •  
  •  
  •  
  •  
  •  

About a year ago I mentioned an objective-c library providing a nice blocks based syntax for tracking reachability called JTSReachability.

Here’s an open source Swift library called SSASwiftReachability from Sebastian that provides a nice clean syntax for monitoring reachability changes in Swift.

This code snippet from the readme shows how to use SSASwiftReachability:

override func viewDidLoad() {
        super.viewDidLoad()

<pre><code>     // MARK: Start Monitoring For Network Reachability Changes.
    SSASwiftReachability.sharedManager?.startMonitoring()

    // MARK: Listen For Network Reachability Changes
    NSNotificationCenter.defaultCenter().addObserver(self, selector: "reachabilityStatusChanged:", name: reachabilityDidChangeNotification, object: nil)
}

func reachabilityStatusChanged(notification: NSNotification) {
    if let info = notification.userInfo {

        if let s = info[reachabilityNotificationStatusItem] {
            print(s.description)
        }
    }
}
</code></pre>

You can find SSASwiftReachability on Github here.

A nice library for monitoring reachability changes in Swift.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments