Mac Developer Library

Developer

MapKit Framework Reference MKUserLocation Class Reference

Options
Deployment Target:

On This Page
Language:

MKUserLocation

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

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

    Availability

    Available in OS X v10.9 and later.

  • 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

    Availability

    Available in OS X v10.9 and later.

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

    Availability

    Available in OS X v10.9 and later.

  • The title to display for the user location annotation.

    Declaration

    Swift

    var title: String?

    Objective-C

    @property(nonatomic, copy) NSString *title

    Availability

    Available in OS X v10.9 and later.

  • The subtitle to display for the user location annotation.

    Declaration

    Swift

    var subtitle: String?

    Objective-C

    @property(nonatomic, copy) NSString *subtitle

    Availability

    Available in OS X v10.9 and later.