iOS Developer Library

Developer

Core Telephony Framework Reference CTTelephonyNetworkInfo Class Reference

Options
Deployment Target:

On This Page
Language:

CTTelephonyNetworkInfo

Use the CTTelephonyNetworkInfo class to respond to changes in the user’s cellular service provider. This occurs, for example, if a user swaps the device’s SIM card with one from another provider, while your application is running. This class also gives you access to the CTCarrier object, which contains information about the user’s home cellular service provider.

  • Information about the user’s cellular service provider. (read-only)

    Declaration

    Swift

    var subscriberCellularProvider: CTCarrier? { get }

    Objective-C

    @property(readonly, retain) CTCarrier *subscriberCellularProvider

    Discussion

    A CTCarrier object that contains information about the user’s home cellular service provider—that is, the provider with whom the user has an account. This information is available immediately after you allocate and initialize the CTTelephonyNetworkInfo object.

    Availability

    Available in iOS 4.0 and later.

  • Dispatched when the user’s cellular service provider information changes.

    Declaration

    Swift

    var subscriberCellularProviderDidUpdateNotifier: ((CTCarrier) -> Void)?

    Objective-C

    @property(nonatomic, copy, nonnull) void (^subscriberCellularProviderDidUpdateNotifier)( CTCarrier *)

    Discussion

    A block object that is dispatched on the default priority global dispatch queue when the user’s cellular provider information changes. This occurs, for example, if a user swaps the device’s SIM card with one from another provider, while your application is running.

    To handle changes in cellular service provider information, define a block in your application and assign it to this property. The block must be implemented to support being called from any context.

    Availability

    Available in iOS 4.0 and later.