iOS Developer Library

Developer

MapKit Framework Reference MKUserLocation Class Reference

Options
Deployment Target:

On This Page
Language:

MKUserLocation

Inherits From


Conforms To


Import Statement


Swift

import MapKit

Objective-C

@import MapKit;

Availability


Available in iOS 3.0 and later

The MKUserLocation class defines a specific type of annotation that identifies the user’s current location. You do not create instances of this class directly. Instead, you retrieve an existing MKUserLocation object from the userLocation property of the map view displayed in your app.

  • location location Property

    The current location of the device. (read-only)

    Declaration

    Swift

    var location: CLLocation! { get }

    Objective-C

    @property(readonly, nonatomic) CLLocation *location

    Discussion

    This property contains nil if the map view is not currently showing the user location or if the user’s location has not yet been determined.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 3.0 and later

  • updating updating Property

    A Boolean value indicating whether the user’s location is currently being updated. (read-only)

    Declaration

    Swift

    var updating: Bool { get }

    Objective-C

    @property(readonly, nonatomic, getter=isUpdating) BOOL updating

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 3.0 and later

  • heading heading Property

    The heading of the user location. (read-only)

    Declaration

    Swift

    var heading: CLHeading! { get }

    Objective-C

    @property(readonly, nonatomic) CLHeading *heading

    Discussion

    This property is nil if the user location tracking mode is not MKUserTrackingModeFollowWithHeading.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 5.0 and later

  • title title Property

    The title to display for the user location annotation.

    Declaration

    Swift

    var title: String!

    Objective-C

    @property(nonatomic, copy) NSString *title

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 3.0 and later

  • subtitle subtitle Property

    The subtitle to display for the user location annotation.

    Declaration

    Swift

    var subtitle: String!

    Objective-C

    @property(nonatomic, copy) NSString *subtitle

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 3.0 and later