Swift check network speed

6.3k Views Asked by At

I want to check the network speed from my swift application. I have found many posts describing the Reachability class specially the way of finding if the connection is reachable or not and if it's a WIFI connection or a WWAN one.

My question: Is it possible to detect the type of the WWAN (2G, 3G, 4G...)?

1

There are 1 best solutions below

3
On BEST ANSWER

You're able to check this with CoreTelephony. For example:

let telInfo = CTTelephonyNetworkInfo()
if telInfo.currentRadioAccessTechnology == CTRadioAccessTechnologyLTE {
    // Device has a LTE connection
}

You can find a list of all the CTRadioAccessTechnology here.

Hopefully this helps!