Llg Llg - 1 year ago 91
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...)?

Answer Source

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!