Probably you should be looking into CTTelephonyNetworkInfo, where you'll find serviceCurrentRadioAccessTechnology
, as well as currentRadioAccessTechnology
. That should offer you what you want.
However, I wouldn't be able to tell you what the key or value for 5G will be. Given they're all Strings though, a new one could just show up and probably a future version of Xcode 12 would add a property to strong type it.
For reference, this SO answer shows how to identify 2G, 3G and 4G.
Later update: Core Telephony Constants has shown up and provides 2 new strings, CTRadioAccessTechnologyNR
and CTRadioAccessTechnologyNRNSA
, both available from iOS 14+ (reasonable given iPhone 12s are first with the tech). This should be reinforced by the term NR, which seems to be part of 5Gs naming 5G NR (New Radio). I don't have a phone to test today, so still yet to confirm where this property will show up, but I'd still guess within CTTelephonyNetworkInfo().serviceCurrentRadioAccessTechnology
.
For reference, to test this, you need to import CoreTelephony
.
Latest update:
Big thanks to Alessandro Martin for sharing this in the comment:
There's a mistake on Apple's part as the CTRadioAccessTechnologyNR and CTRadioAccessTechnologyNRSA strings are marked as available from iOS 14.0 but in fact it should be iOS 14.1 Take into account that a user on iOS 14.2 beta will pass the availability check but it will crash with a null pointer exception when trying to access these strings as they are not available to them.