iOS Developer Library

Developer

CoreTelephony Framework Reference CTCarrier Class Reference

Options
Deployment Target:

On This Page
Language:

CTCarrier

Inherits From


Conforms To


Import Statement


Swift

import CoreTelephony

Objective-C

@import CoreTelephony;

Availability


Available in iOS 4.0 and later

Use the CTCarrier class to obtain information about the user’s home cellular service provider, such as its unique identifier and whether or not it allows VoIP (Voice over Internet Protocol) calls on its network.

  • Indicates if the carrier allows VoIP calls to be made on its network. (read-only)

    Declaration

    Swift

    var allowsVOIP: Bool { get }

    Objective-C

    @property(nonatomic, readonly, assign) BOOL allowsVOIP

    Discussion

    A read-only Boolean value that is YEStrue if the carrier allows VoIP calls to be made on its network, or NOfalse if not.

    If you configure a device for a carrier and then remove the SIM card, this property retains the Boolean value indicating the carrier’s policy regarding VoIP.

    Import Statement

    Objective-C

    @import CoreTelephony;

    Swift

    import CoreTelephony

    Availability

    Available in iOS 4.0 and later

  • The name of the user’s home cellular service provider. (read-only)

    Declaration

    Swift

    var carrierName: String! { get }

    Objective-C

    @property(nonatomic, readonly, retain) NSString *carrierName

    Discussion

    This string is provided by the carrier and formatted for presentation to the user. The value does not change if the user is roaming; it always represents the provider with whom the user has an account.

    If you configure a device for a carrier and then remove the SIM card, this property retains the name of the carrier.

    The value for this property is nil if the device was never configured for a carrier.

    Import Statement

    Objective-C

    @import CoreTelephony;

    Swift

    import CoreTelephony

    Availability

    Available in iOS 4.0 and later

  • The ISO country code for the user’s cellular service provider. (read-only)

    Declaration

    Swift

    var isoCountryCode: String! { get }

    Objective-C

    @property(nonatomic, readonly, retain) NSString *isoCountryCode

    Discussion

    This property uses the ISO 3166-1 country code representation.

    The value for this property is nil if any of the following apply:

    • The device is in Airplane mode.

    • There is no SIM card in the device.

    • The device is outside of cellular service range.

    Import Statement

    Objective-C

    @import CoreTelephony;

    Swift

    import CoreTelephony

    Availability

    Available in iOS 4.0 and later

  • The mobile country code (MCC) for the user’s cellular service provider. (read-only)

    Declaration

    Swift

    var mobileCountryCode: String! { get }

    Objective-C

    @property(nonatomic, readonly, retain) NSString *mobileCountryCode

    Discussion

    A read-only NSString object that contains the numeric mobile country code for the user's cellular service provider. MCCs are defined by ITU-T Recommendation E.212, “List of Mobile Country or Geographical Area Codes.” Typing this property as an NSString object, rather than a number type, ensures that leading zeroes in MCCs are respected.

    The value for this property is nil if any of the following apply:

    • There is no SIM card in the device.

    • The device is outside of cellular service range.

    The value may be nil on hardware prior to iPhone 4S when in Airplane mode.

    Import Statement

    Objective-C

    @import CoreTelephony;

    Swift

    import CoreTelephony

    Availability

    Available in iOS 4.0 and later

  • The mobile network code (MNC) for the user’s cellular service provider. (read-only)

    Declaration

    Swift

    var mobileNetworkCode: String! { get }

    Objective-C

    @property(nonatomic, readonly, retain) NSString *mobileNetworkCode

    Discussion

    A read-only NSString object that represents the numeric mobile network code for the user’s cellular service provider. Typing this property as an NSString object, rather than a number type, ensures that leading zeroes in MNCs are respected.

    The value for this property is nil if any of the following apply:

    • There is no SIM card in the device.

    • The device is outside of cellular service range.

    The value may be nil on hardware prior to iPhone 4S when in Airplane mode.

    Import Statement

    Objective-C

    @import CoreTelephony;

    Swift

    import CoreTelephony

    Availability

    Available in iOS 4.0 and later