https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
h

Hossein Amini

06/22/2021, 6:43 AM
What’s the proper way to use iOS apis in the iOSMain module?  I want to check if the devices is connected to the network or not, so I want to use NWPathMonitor() (following this tutorial: https://www.hackingwithswift.com/example-code/networking/how-to-check-for-internet-connectivity-using-nwpathmonitor), but it cannot be resolved in the iOSMain. Is it possible to use all the iOS apis in the iOSMain module or only some of them is possible? Also to use UserDefaults, we must use NSUserDefaults(swift 2) which is an older version of the UserDefaults(swift 3)
8 Views