-3

I am using Swift 3 and Xcode 8. All the other scripts and stuff online to do this all raise a lot of errors. How would I in a simple way make the app check for an Internet connection when it was launched and if it had one to continue and if it doesn't have a connection to show the user a popup saying so?

I am open to any suggestion.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
doodle911
  • 55
  • 2
  • 9

1 Answers1

0

The easiest way to check for internet connectivity is to use the iOS reachability api.

It's available in the SystemConfiguration module.

Objective-C Reachability Example

A good example of using SCNetworkReachability in swift is found in the stack overflow answer:

SCNetworkReachability in swift

I hope this helps! Have a nice day!

Community
  • 1
  • 1
KGJ
  • 76
  • 3