Radio Access Technology Constants

We are checking for cellular mode using the code below.

When the code below is executed, is it correct to convey the status value of the actually connected cellular environment?

Sometimes HSDPA or WCDMA is output.

I would like to inquire under what conditions the value is output.

[Code] func getCellularConnectionType() -> String { if #available(iOS 14.1, *) { if let radioAccessTechnology = networkInfo.serviceCurrentRadioAccessTechnology?.values.first { Debug.log("Radio Access Technology: (radioAccessTechnology)") switch radioAccessTechnology { case CTRadioAccessTechnologyLTE: return "LTE" case CTRadioAccessTechnologyNRNSA: return "5G-NSA" case CTRadioAccessTechnologyNR: return "5G-SA" default: return "ETC" } } } return "Cellular" }

When posting code examples, please use the Code Block formatting style, like this:

func getCellularConnectionType() -> String {
    return "This is readable now."
}
Radio Access Technology Constants
 
 
Q