Llg Llg - 1 month ago 11x
Swift Question

Swift check network speed

I want to check the network speed from my swift application. I have found many posts describing the

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...)?


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!