I have a iphone app that has the capability to send messages. I want to alert user when sim card is not available in iphone. So i tried below three function to check sim car
var isSimCardAvailable: Bool {
let info = CTTelephonyNetworkInfo()
if let carrier = info.subscriberCellularProvider {
if let code = carrier.mobileNetworkCode {
if !code.isEmpty {
return true
}
}
}
return false
}