Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check network status in Swift

Tags:

swift

How can I check network status in Swift? In Objective-C Reachability.h .m files were available. What now? How can I check whether I am online or offline?

like image 640
János Avatar asked Jul 01 '14 18:07

János


Video Answer


1 Answers

If you're looking for a Swift implementation of Apple's Reachability class, you could take a look at this:

http://github.com/ashleymills/Reachability.swift

It's a drop in class, using notifications and closures.

like image 64
Ashley Mills Avatar answered Oct 24 '22 18:10

Ashley Mills