I need a function to start only when the system detects that there is no Internet connection, and then another function to start when the system detects an Internet connection.
I am thinking of something like this:
func onInternetConnection() {
I will also need a way to detect when the system reconnects, so I can tell the user that he is reconnecting, as in Facebook Messenger.
How can i do this?
I use Moya / Alamofire for my network layer.
source share