iOS Developer Library

Developer

MapKit Framework Reference MKPolyline Class Reference

Options
Deployment Target:

On This Page
Language:

MKPolyline

The MKPolyline class represents a shape consisting of one or more points that define connecting line segments. The points are connected end-to-end in the order they are provided. The first and last points are not connected to each other.

Import Statement


Swift

import MapKit

Objective-C

@import MapKit;

Availability


Available in iOS 4.0 and later.
  • Creates and returns an MKPolyline object from the specified set of map points.

    Declaration

    Swift

    convenience init!(points points: UnsafeMutablePointer<MKMapPoint>, count count: Int)

    Objective-C

    + (instancetype)polylineWithPoints:(MKMapPoint *)points count:(NSUInteger)count

    Parameters

    points

    The array of map points defining the shape. The data in this array is copied to the new object.

    count

    The number of items in the points array.

    Return Value

    A new polyline object.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 4.0 and later.

  • Creates and returns an MKPolyline object from the specified set of coordinates.

    Declaration

    Swift

    convenience init!(coordinates coords: UnsafeMutablePointer<CLLocationCoordinate2D>, count count: Int)

    Objective-C

    + (instancetype)polylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count

    Parameters

    coords

    The array of coordinates defining the shape. The data in this array is copied to the new object.

    count

    The number of items in the coords array.

    Return Value

    A new polyline object.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 4.0 and later.