iOS Developer Library

Developer

CoreTelephony Framework Reference CTTelephonyNetworkInfo Class Reference

Options
Deployment Target:

On This Page
Language:

CTTelephonyNetworkInfo

Inherits From


Conforms To


Import Statement


Swift

import CoreTelephony

Objective-C

@import CoreTelephony;

Availability


Available in iOS 4.0 and later

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.

    Import Statement

    Objective-C

    @import CoreTelephony;

    Swift

    import CoreTelephony

    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) 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.

    Import Statement

    Objective-C

    @import CoreTelephony;

    Swift

    import CoreTelephony

    Availability

    Available in iOS 4.0 and later