CTTelephonyNetworkInfo.currentRadioAccessTechnology is deprecated in iOS 12. so is there any api to get the network type?. we can use NWPathMonitor to know wifi, cellular, ethernet type but not 3g,4g,5g etc. Is there any complete solution for this.
Determine network type in iOS 14 Swift 5 without Thirdparty Library
1.4k Views Asked by SreekanthI At
2
There are 2 best solutions below
0
Gordon Dove
On
CTTelephonyNetworkInfo.currentRadioAccessTechnology was deprecated in iOS 12, but only because iOS 12 introduced multisim support; hence there is no single radio access technology.
The same information is available in the dictionary CTTelephonyNetworkInfo.serviceCurrentRadioAccessTechnology.
In most cases, you can just use CTTelephonyNetworkInfo.serviceCurrentRadioAccessTechnology[CTTelephonyNetworkInfo.dataServiceIdentifier]
Related Questions in IOS
- Overlapping UICollectionView in storyboard
- Cannot pod spec lint because of undeclared type errors
- Is the transactionReceipt data present in dataWithContentsOfURL?
- UIWebView Screen Fitting Issue
- ZXingObjC encoding issues
- iOS: None of the valid provisioning profiles allowed the specific entitlements
- How to hide "Now playing url" in control center
- CloudKit: Preventing Duplicate Records
- Slow performance on ipad erasing image
- Swift code with multiple NSDateFormatter - optimization
- iOS 8.3 Safari crashes on input type=file
- TTTTimeIntervalFormatter always returns strings in English
- How do I add multiple in app purchases in Swift Spritekit?
- Setup code for xibs in iOS. -awakFromNb:
- iOS Voice Over only reads out the title of any alert views
Related Questions in NETWORKING
- kernel module does not print packet info
- Packet drops in multicast when multiple instance of listner are running
- Timing packets on a traffic server
- How to use Espresso Idling Resource for network calls
- Dummynet does not match on flows
- Sending a notification from OS X to iOS
- Swift ios viewDidLoad or viewDidAppear
- Update player list on all clients on new connection
- Issues regarding multiplayer networking: input
- nmap does not show all open ports
- Getting and Sending Data between a Server and Client
- Read file from local PC from network deployed app to InputStream
- Does iOS block a URL if we couldn't connect to the URL for 'n' times?
- Is Socket.Available guaranteed to throw a SocketException on disconnect?
- android out of cell service
Related Questions in SWIFT5
- 'Module was not compiled for testing' when using @testable
- SwiftUI strange tabbar behaviour with groups
- Create Circular Bar and Custom Swipe for TableView Cell in Swift 5?
- Array cannot be inferred Error in Xcode 12 with Swift 5
- Non-Nil User Crashing When Unwrapped - Firebase, SwiftUI
- How to disconnect inactive users in an application chat xcode
- ULTextField values disappears when the device orientation changes
- Weak reference to delegate/coordinator is lost on iOS 12 and 11, works on iOS 13/14. Swift 5
- Xcode 11.6 having error while importing custom framework: Module compiled with Swift 5.3 cannot be imported by the Swift 5.2.4
- Having trouble with ObserveObject Array changes in my code
- didFinishPickingMediaWithInfo is not calling in Xcode 12
- SwiftUI binding of related entity by using @FetchRequest does not update the view
- AVPlayerViewController Swipe UISwipeGestureRecognizer.up not working Xcode 12 tvOS 14
- How to add a function with parameter in addTarget of UIButton in swift 5?
- Trying to get a popover in a certain size
Related Questions in IOS14
- "Spotlight quit unexpectedly" in MacOS Catalina version 10.15.4, This crash happening after I have installed Xcode 12
- Starting with iOS 14 or 14.0.1 WiFi works but LTE does NOT
- Uploading a file to WebDAV server using AlamoFire
- Remove `UIMenu` from `navigationBar.backBarButtonItem`
- Since iOS 14, my app does not display images only when with the debugger or a device with iOS 13. Also, the keyboard won't show all keys
- Proxy Wrap the iOS 14 Logger class
- How can I check whether my shared code is running in a WidgetKit widget or full app?
- Crash in the execution of a queue glmtl.telemetry
- AuthorizationStatus for CLLocationManager is deprecated on iOS 14
- Align content to left - SwiftUI iOS 14 Widget
- Error MT2002: Failed to resolve assembly: Microsoft.WindowsAzure.MobileServices.iOS
- Issue with computed property not being updated for showing Sheet in Xcode 12 (worked before)
- MPEG4 videos cannot be played on iOS14 (AVPlayer issue)
- App crashes after keyboard shows only in TestFlight release and IOS 14
- Perform UICollectionView reloadData without animation
Related Questions in NWPATHMONITOR
- NWPathMonitor's pathUpdateHandler block is getting called on app background to foreground transition
- NWEndPoint: it returns nil when getting gateway's IP address from another VC
- Determine network type in iOS 14 Swift 5 without Thirdparty Library
- How to detect the switching to different wifi networks in iOS?
- Why doesn't path.status report the network connection status correctly in my Swift app?
- Why does webSocketTask.receive never complete and how do I force completion in my Swift app?
- NWPathMonitor error when monitoring the internet connection
- Swift, iOS: Reachability (NWPathMonitor) vs. Ping
- How to find out if a Wi-Fi is with or without an internet connection
- Best Approach for handling Network Connectivity Issue - Swift 5
- Why network status does not get updated in swift?
- nw_path_monitor_t / NWPathMonitor: is cancelling on background / resuming on foreground necessary?
- Issue with NWPathMonitor class on internet changes
- Use NWPathMonitor with Swift Modern Concurrency (AsyncStream) vs GCD (DispatchQueue)
- NSNotificationCenter posting notifications doesn't work
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?