I am using the Reachability library on github found [here](https://github.com/ashleymills/Reachability.swift). I want to check whether device is online by clicking on a button. I am new to Reachability so from what I have seen, you have to start listening for the change and then test the connection and then stop listening. So far I have this in my button action but when I click the button, nothing gets printed to console. 

```
var reachability: Reachability!
do {
    try reachability?.startNotifier()
} catch {
    print("Unable to start notifier")
}

reachability?.whenReachable = { reachability in

    DispatchQueue.main.async {
        if reachability.isReachableViaWiFi {
            print("Reachable via WiFi")
        } else {
            print("Reachable via Cellular")
        }
    }
}

reachability?.whenUnreachable = { reachability in

    DispatchQueue.main.async {
        print("Not reachable")
    }
}

reachability?.stopNotifier()

```