Documentation Archive Developer
Search

MapKit Changes for Objective-C

MapKit

MKAnnotationView.h

MKDirectionsRequest.h

Declaration
From
- (MKMapItem *)destination
To
@property(nonatomic, strong, nullable) MKMapItem *destination

Declaration
From
- (MKMapItem *)source
To
@property(nonatomic, strong, nullable) MKMapItem *source

MKDirectionsResponse.h

Declaration
From
@property(nonatomic, readonly) NSArray *routes
To
@property(nonatomic, readonly, nonnull) NSArray<MKRoute *> *routes

Declaration
From
@property(nonatomic, readonly) NSArray *advisoryNotices
To
@property(nonatomic, readonly, nonnull) NSArray<NSString *> *advisoryNotices

Modified MKRoute.steps
Declaration
From
@property(nonatomic, readonly) NSArray *steps
To
@property(nonatomic, readonly, nonnull) NSArray<MKRouteStep *> *steps

MKDirectionsTypes.h

MKLocalSearchResponse.h

Declaration
From
@property(nonatomic, readonly) NSArray *mapItems
To
@property(nonatomic, readonly, nonnull) NSArray<MKMapItem *> *mapItems

MKMapCamera.h

MKMapItem.h

Declaration
From
- (BOOL)openInMapsWithLaunchOptions:(NSDictionary *)launchOptions
To
- (BOOL)openInMapsWithLaunchOptions:(NSDictionary<NSString *,id> * _Nullable)launchOptions

Declaration
From
+ (BOOL)openMapsWithItems:(NSArray *)mapItems launchOptions:(NSDictionary *)launchOptions
To
+ (BOOL)openMapsWithItems:(NSArray<MKMapItem *> * _Nonnull)mapItems launchOptions:(NSDictionary<NSString *,id> * _Nullable)launchOptions

MKMapView.h

Declaration
From
- (void)addAnnotations:(NSArray *)annotations
To
- (void)addAnnotations:(NSArray<id<MKAnnotation>> * _Nonnull)annotations

Declaration
From
- (void)addOverlays:(NSArray *)overlays
To
- (void)addOverlays:(NSArray<id<MKOverlay>> * _Nonnull)overlays

Declaration
From
- (void)addOverlays:(NSArray *)overlays level:(MKOverlayLevel)level
To
- (void)addOverlays:(NSArray<id<MKOverlay>> * _Nonnull)overlays level:(MKOverlayLevel)level

Declaration
From
@property(nonatomic, readonly) NSArray *annotations
To
@property(nonatomic, readonly, nonnull) NSArray<id<MKAnnotation>> *annotations

Declaration
From
- (NSSet *)annotationsInMapRect:(MKMapRect)mapRect
To
- (NSSet<id<MKAnnotation>> * _Nonnull)annotationsInMapRect:(MKMapRect)mapRect

Declaration
From
@property(nonatomic, readonly) NSArray *overlays
To
@property(nonatomic, readonly, nonnull) NSArray<id<MKOverlay>> *overlays

Declaration
From
- (NSArray *)overlaysInLevel:(MKOverlayLevel)level
To
- (NSArray<id<MKOverlay>> * _Nonnull)overlaysInLevel:(MKOverlayLevel)level

Declaration
From
- (void)removeAnnotations:(NSArray *)annotations
To
- (void)removeAnnotations:(NSArray<id<MKAnnotation>> * _Nonnull)annotations

Declaration
From
- (void)removeOverlays:(NSArray *)overlays
To
- (void)removeOverlays:(NSArray<id<MKOverlay>> * _Nonnull)overlays

Declaration
From
@property(nonatomic, copy) NSArray *selectedAnnotations
To
@property(nonatomic, copy, nonnull) NSArray<id<MKAnnotation>> *selectedAnnotations

Declaration
From
- (void)showAnnotations:(NSArray *)annotations animated:(BOOL)animated
To
- (void)showAnnotations:(NSArray<id<MKAnnotation>> * _Nonnull)annotations animated:(BOOL)animated

Declaration
From
- (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views
To
- (void)mapView:(MKMapView * _Nonnull)mapView didAddAnnotationViews:(NSArray<MKAnnotationView *> * _Nonnull)views

Declaration
From
- (void)mapView:(MKMapView *)mapView didAddOverlayRenderers:(NSArray *)renderers
To
- (void)mapView:(MKMapView * _Nonnull)mapView didAddOverlayRenderers:(NSArray<MKOverlayRenderer *> * _Nonnull)renderers

MKOverlayPathRenderer.h

Declaration
From
@property(copy) NSArray *lineDashPattern
To
@property(copy, nullable) NSArray<NSNumber *> *lineDashPattern

MKPinAnnotationView.h

Deprecation
From--
ToiOS 9.0

Deprecation
From--
ToiOS 9.0

Deprecation
From--
ToiOS 9.0

Deprecation
From--
ToiOS 9.0

MKPlacemark.h

Declaration
From
- (instancetype)initWithCoordinate:(CLLocationCoordinate2D)coordinate addressDictionary:(NSDictionary *)addressDictionary
To
- (instancetype _Nonnull)initWithCoordinate:(CLLocationCoordinate2D)coordinate addressDictionary:(NSDictionary<NSString *,id> * _Nullable)addressDictionary

MKPolygon.h

Declaration
From
@property(readonly) NSArray *interiorPolygons
To
@property(readonly, nullable) NSArray<MKPolygon *> *interiorPolygons

Declaration
From
+ (instancetype)polygonWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count interiorPolygons:(NSArray *)interiorPolygons
To
+ (instancetype _Nonnull)polygonWithCoordinates:(CLLocationCoordinate2D * _Nonnull)coords count:(NSUInteger)count interiorPolygons:(NSArray<MKPolygon *> * _Nullable)interiorPolygons

Declaration
From
+ (instancetype)polygonWithPoints:(MKMapPoint *)points count:(NSUInteger)count interiorPolygons:(NSArray *)interiorPolygons
To
+ (instancetype _Nonnull)polygonWithPoints:(MKMapPoint * _Nonnull)points count:(NSUInteger)count interiorPolygons:(NSArray<MKPolygon *> * _Nullable)interiorPolygons

MKTypes.h