icrate 0.1.2

Bindings to Apple's frameworks
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AppKit::*;
use crate::Contacts::*;
use crate::CoreLocation::*;
use crate::Foundation::*;
use crate::MapKit::*;

ns_enum!(
    #[underlying(NSInteger)]
    pub enum MKOverlayLevel {
        MKOverlayLevelAboveRoads = 0,
        MKOverlayLevelAboveLabels = 1,
    }
);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum MKUserTrackingMode {
        MKUserTrackingModeNone = 0,
        MKUserTrackingModeFollow = 1,
        MKUserTrackingModeFollowWithHeading = 2,
    }
);

extern_static!(MKMapViewDefaultAnnotationViewReuseIdentifier: &'static NSString);

extern_static!(MKMapViewDefaultClusterAnnotationViewReuseIdentifier: &'static NSString);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "MapKit_MKMapView")]
    pub struct MKMapView;

    #[cfg(feature = "MapKit_MKMapView")]
    unsafe impl ClassType for MKMapView {
        #[inherits(NSResponder, NSObject)]
        type Super = NSView;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(feature = "MapKit_MKMapView")]
unsafe impl NSAccessibility for MKMapView {}

#[cfg(feature = "MapKit_MKMapView")]
unsafe impl NSAccessibilityElementProtocol for MKMapView {}

#[cfg(feature = "MapKit_MKMapView")]
unsafe impl NSAnimatablePropertyContainer for MKMapView {}

#[cfg(feature = "MapKit_MKMapView")]
unsafe impl NSAppearanceCustomization for MKMapView {}

#[cfg(feature = "MapKit_MKMapView")]
unsafe impl NSCoding for MKMapView {}

#[cfg(feature = "MapKit_MKMapView")]
unsafe impl NSDraggingDestination for MKMapView {}

#[cfg(feature = "MapKit_MKMapView")]
unsafe impl NSObjectProtocol for MKMapView {}

#[cfg(feature = "MapKit_MKMapView")]
unsafe impl NSUserInterfaceItemIdentification for MKMapView {}

extern_methods!(
    #[cfg(feature = "MapKit_MKMapView")]
    unsafe impl MKMapView {
        #[method_id(@__retain_semantics Other delegate)]
        pub unsafe fn delegate(&self) -> Option<Id<ProtocolObject<dyn MKMapViewDelegate>>>;

        #[method(setDelegate:)]
        pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn MKMapViewDelegate>>);

        #[deprecated]
        #[method(mapType)]
        pub unsafe fn mapType(&self) -> MKMapType;

        #[deprecated]
        #[method(setMapType:)]
        pub unsafe fn setMapType(&self, map_type: MKMapType);

        #[cfg(feature = "MapKit_MKMapConfiguration")]
        #[method_id(@__retain_semantics Other preferredConfiguration)]
        pub unsafe fn preferredConfiguration(&self) -> Id<MKMapConfiguration>;

        #[cfg(feature = "MapKit_MKMapConfiguration")]
        #[method(setPreferredConfiguration:)]
        pub unsafe fn setPreferredConfiguration(
            &self,
            preferred_configuration: &MKMapConfiguration,
        );

        #[method(region)]
        pub unsafe fn region(&self) -> MKCoordinateRegion;

        #[method(setRegion:)]
        pub unsafe fn setRegion(&self, region: MKCoordinateRegion);

        #[method(setRegion:animated:)]
        pub unsafe fn setRegion_animated(&self, region: MKCoordinateRegion, animated: bool);

        #[method(centerCoordinate)]
        pub unsafe fn centerCoordinate(&self) -> CLLocationCoordinate2D;

        #[method(setCenterCoordinate:)]
        pub unsafe fn setCenterCoordinate(&self, center_coordinate: CLLocationCoordinate2D);

        #[method(setCenterCoordinate:animated:)]
        pub unsafe fn setCenterCoordinate_animated(
            &self,
            coordinate: CLLocationCoordinate2D,
            animated: bool,
        );

        #[method(regionThatFits:)]
        pub unsafe fn regionThatFits(&self, region: MKCoordinateRegion) -> MKCoordinateRegion;

        #[method(visibleMapRect)]
        pub unsafe fn visibleMapRect(&self) -> MKMapRect;

        #[method(setVisibleMapRect:)]
        pub unsafe fn setVisibleMapRect(&self, visible_map_rect: MKMapRect);

        #[method(setVisibleMapRect:animated:)]
        pub unsafe fn setVisibleMapRect_animated(&self, map_rect: MKMapRect, animate: bool);

        #[method(mapRectThatFits:)]
        pub unsafe fn mapRectThatFits(&self, map_rect: MKMapRect) -> MKMapRect;

        #[method(setVisibleMapRect:edgePadding:animated:)]
        pub unsafe fn setVisibleMapRect_edgePadding_animated(
            &self,
            map_rect: MKMapRect,
            insets: NSEdgeInsets,
            animate: bool,
        );

        #[method(mapRectThatFits:edgePadding:)]
        pub unsafe fn mapRectThatFits_edgePadding(
            &self,
            map_rect: MKMapRect,
            insets: NSEdgeInsets,
        ) -> MKMapRect;

        #[cfg(feature = "MapKit_MKMapCamera")]
        #[method_id(@__retain_semantics Other camera)]
        pub unsafe fn camera(&self) -> Id<MKMapCamera>;

        #[cfg(feature = "MapKit_MKMapCamera")]
        #[method(setCamera:)]
        pub unsafe fn setCamera(&self, camera: &MKMapCamera);

        #[cfg(feature = "MapKit_MKMapCamera")]
        #[method(setCamera:animated:)]
        pub unsafe fn setCamera_animated(&self, camera: &MKMapCamera, animated: bool);

        #[cfg(feature = "MapKit_MKMapCameraZoomRange")]
        #[method_id(@__retain_semantics Other cameraZoomRange)]
        pub unsafe fn cameraZoomRange(&self) -> Id<MKMapCameraZoomRange>;

        #[cfg(feature = "MapKit_MKMapCameraZoomRange")]
        #[method(setCameraZoomRange:)]
        pub unsafe fn setCameraZoomRange(&self, camera_zoom_range: Option<&MKMapCameraZoomRange>);

        #[cfg(feature = "MapKit_MKMapCameraZoomRange")]
        #[method(setCameraZoomRange:animated:)]
        pub unsafe fn setCameraZoomRange_animated(
            &self,
            camera_zoom_range: Option<&MKMapCameraZoomRange>,
            animated: bool,
        );

        #[cfg(feature = "MapKit_MKMapCameraBoundary")]
        #[method_id(@__retain_semantics Other cameraBoundary)]
        pub unsafe fn cameraBoundary(&self) -> Option<Id<MKMapCameraBoundary>>;

        #[cfg(feature = "MapKit_MKMapCameraBoundary")]
        #[method(setCameraBoundary:)]
        pub unsafe fn setCameraBoundary(&self, camera_boundary: Option<&MKMapCameraBoundary>);

        #[cfg(feature = "MapKit_MKMapCameraBoundary")]
        #[method(setCameraBoundary:animated:)]
        pub unsafe fn setCameraBoundary_animated(
            &self,
            camera_boundary: Option<&MKMapCameraBoundary>,
            animated: bool,
        );

        #[method(convertCoordinate:toPointToView:)]
        pub unsafe fn convertCoordinate_toPointToView(
            &self,
            coordinate: CLLocationCoordinate2D,
            view: Option<&NSView>,
        ) -> CGPoint;

        #[method(convertPoint:toCoordinateFromView:)]
        pub unsafe fn convertPoint_toCoordinateFromView(
            &self,
            point: CGPoint,
            view: Option<&NSView>,
        ) -> CLLocationCoordinate2D;

        #[method(convertRegion:toRectToView:)]
        pub unsafe fn convertRegion_toRectToView(
            &self,
            region: MKCoordinateRegion,
            view: Option<&NSView>,
        ) -> CGRect;

        #[method(convertRect:toRegionFromView:)]
        pub unsafe fn convertRect_toRegionFromView(
            &self,
            rect: CGRect,
            view: Option<&NSView>,
        ) -> MKCoordinateRegion;

        #[method(isZoomEnabled)]
        pub unsafe fn isZoomEnabled(&self) -> bool;

        #[method(setZoomEnabled:)]
        pub unsafe fn setZoomEnabled(&self, zoom_enabled: bool);

        #[method(isScrollEnabled)]
        pub unsafe fn isScrollEnabled(&self) -> bool;

        #[method(setScrollEnabled:)]
        pub unsafe fn setScrollEnabled(&self, scroll_enabled: bool);

        #[method(isRotateEnabled)]
        pub unsafe fn isRotateEnabled(&self) -> bool;

        #[method(setRotateEnabled:)]
        pub unsafe fn setRotateEnabled(&self, rotate_enabled: bool);

        #[method(isPitchEnabled)]
        pub unsafe fn isPitchEnabled(&self) -> bool;

        #[method(setPitchEnabled:)]
        pub unsafe fn setPitchEnabled(&self, pitch_enabled: bool);

        #[method(showsUserTrackingButton)]
        pub unsafe fn showsUserTrackingButton(&self) -> bool;

        #[method(setShowsUserTrackingButton:)]
        pub unsafe fn setShowsUserTrackingButton(&self, shows_user_tracking_button: bool);

        #[method(pitchButtonVisibility)]
        pub unsafe fn pitchButtonVisibility(&self) -> MKFeatureVisibility;

        #[method(setPitchButtonVisibility:)]
        pub unsafe fn setPitchButtonVisibility(&self, pitch_button_visibility: MKFeatureVisibility);

        #[method(showsPitchControl)]
        pub unsafe fn showsPitchControl(&self) -> bool;

        #[method(setShowsPitchControl:)]
        pub unsafe fn setShowsPitchControl(&self, shows_pitch_control: bool);

        #[method(showsZoomControls)]
        pub unsafe fn showsZoomControls(&self) -> bool;

        #[method(setShowsZoomControls:)]
        pub unsafe fn setShowsZoomControls(&self, shows_zoom_controls: bool);

        #[method(showsCompass)]
        pub unsafe fn showsCompass(&self) -> bool;

        #[method(setShowsCompass:)]
        pub unsafe fn setShowsCompass(&self, shows_compass: bool);

        #[method(showsScale)]
        pub unsafe fn showsScale(&self) -> bool;

        #[method(setShowsScale:)]
        pub unsafe fn setShowsScale(&self, shows_scale: bool);

        #[cfg(feature = "MapKit_MKPointOfInterestFilter")]
        #[deprecated]
        #[method_id(@__retain_semantics Other pointOfInterestFilter)]
        pub unsafe fn pointOfInterestFilter(&self) -> Option<Id<MKPointOfInterestFilter>>;

        #[cfg(feature = "MapKit_MKPointOfInterestFilter")]
        #[deprecated]
        #[method(setPointOfInterestFilter:)]
        pub unsafe fn setPointOfInterestFilter(
            &self,
            point_of_interest_filter: Option<&MKPointOfInterestFilter>,
        );

        #[deprecated = "Use pointOfInterestFilter"]
        #[method(showsPointsOfInterest)]
        pub unsafe fn showsPointsOfInterest(&self) -> bool;

        #[deprecated = "Use pointOfInterestFilter"]
        #[method(setShowsPointsOfInterest:)]
        pub unsafe fn setShowsPointsOfInterest(&self, shows_points_of_interest: bool);

        #[deprecated = "None"]
        #[method(showsBuildings)]
        pub unsafe fn showsBuildings(&self) -> bool;

        #[deprecated = "None"]
        #[method(setShowsBuildings:)]
        pub unsafe fn setShowsBuildings(&self, shows_buildings: bool);

        #[deprecated]
        #[method(showsTraffic)]
        pub unsafe fn showsTraffic(&self) -> bool;

        #[deprecated]
        #[method(setShowsTraffic:)]
        pub unsafe fn setShowsTraffic(&self, shows_traffic: bool);

        #[method(showsUserLocation)]
        pub unsafe fn showsUserLocation(&self) -> bool;

        #[method(setShowsUserLocation:)]
        pub unsafe fn setShowsUserLocation(&self, shows_user_location: bool);

        #[cfg(feature = "MapKit_MKUserLocation")]
        #[method_id(@__retain_semantics Other userLocation)]
        pub unsafe fn userLocation(&self) -> Id<MKUserLocation>;

        #[method(userTrackingMode)]
        pub unsafe fn userTrackingMode(&self) -> MKUserTrackingMode;

        #[method(setUserTrackingMode:)]
        pub unsafe fn setUserTrackingMode(&self, user_tracking_mode: MKUserTrackingMode);

        #[method(setUserTrackingMode:animated:)]
        pub unsafe fn setUserTrackingMode_animated(&self, mode: MKUserTrackingMode, animated: bool);

        #[method(isUserLocationVisible)]
        pub unsafe fn isUserLocationVisible(&self) -> bool;

        #[method(addAnnotation:)]
        pub unsafe fn addAnnotation(&self, annotation: &ProtocolObject<dyn MKAnnotation>);

        #[cfg(feature = "Foundation_NSArray")]
        #[method(addAnnotations:)]
        pub unsafe fn addAnnotations(
            &self,
            annotations: &NSArray<ProtocolObject<dyn MKAnnotation>>,
        );

        #[method(removeAnnotation:)]
        pub unsafe fn removeAnnotation(&self, annotation: &ProtocolObject<dyn MKAnnotation>);

        #[cfg(feature = "Foundation_NSArray")]
        #[method(removeAnnotations:)]
        pub unsafe fn removeAnnotations(
            &self,
            annotations: &NSArray<ProtocolObject<dyn MKAnnotation>>,
        );

        #[cfg(feature = "Foundation_NSArray")]
        #[method_id(@__retain_semantics Other annotations)]
        pub unsafe fn annotations(&self) -> Id<NSArray<ProtocolObject<dyn MKAnnotation>>>;

        #[cfg(feature = "Foundation_NSSet")]
        #[method_id(@__retain_semantics Other annotationsInMapRect:)]
        pub unsafe fn annotationsInMapRect(
            &self,
            map_rect: MKMapRect,
        ) -> Id<NSSet<ProtocolObject<dyn MKAnnotation>>>;

        #[cfg(feature = "MapKit_MKAnnotationView")]
        #[method_id(@__retain_semantics Other viewForAnnotation:)]
        pub unsafe fn viewForAnnotation(
            &self,
            annotation: &ProtocolObject<dyn MKAnnotation>,
        ) -> Option<Id<MKAnnotationView>>;

        #[cfg(all(feature = "Foundation_NSString", feature = "MapKit_MKAnnotationView"))]
        #[method_id(@__retain_semantics Other dequeueReusableAnnotationViewWithIdentifier:)]
        pub unsafe fn dequeueReusableAnnotationViewWithIdentifier(
            &self,
            identifier: &NSString,
        ) -> Option<Id<MKAnnotationView>>;

        #[cfg(all(feature = "Foundation_NSString", feature = "MapKit_MKAnnotationView"))]
        #[method_id(@__retain_semantics Other dequeueReusableAnnotationViewWithIdentifier:forAnnotation:)]
        pub unsafe fn dequeueReusableAnnotationViewWithIdentifier_forAnnotation(
            &self,
            identifier: &NSString,
            annotation: &ProtocolObject<dyn MKAnnotation>,
        ) -> Id<MKAnnotationView>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(registerClass:forAnnotationViewWithReuseIdentifier:)]
        pub unsafe fn registerClass_forAnnotationViewWithReuseIdentifier(
            &self,
            view_class: Option<&AnyClass>,
            identifier: &NSString,
        );

        #[method(selectAnnotation:animated:)]
        pub unsafe fn selectAnnotation_animated(
            &self,
            annotation: &ProtocolObject<dyn MKAnnotation>,
            animated: bool,
        );

        #[method(deselectAnnotation:animated:)]
        pub unsafe fn deselectAnnotation_animated(
            &self,
            annotation: Option<&ProtocolObject<dyn MKAnnotation>>,
            animated: bool,
        );

        #[cfg(feature = "Foundation_NSArray")]
        #[method_id(@__retain_semantics Other selectedAnnotations)]
        pub unsafe fn selectedAnnotations(&self) -> Id<NSArray<ProtocolObject<dyn MKAnnotation>>>;

        #[cfg(feature = "Foundation_NSArray")]
        #[method(setSelectedAnnotations:)]
        pub unsafe fn setSelectedAnnotations(
            &self,
            selected_annotations: &NSArray<ProtocolObject<dyn MKAnnotation>>,
        );

        #[method(annotationVisibleRect)]
        pub unsafe fn annotationVisibleRect(&self) -> CGRect;

        #[cfg(feature = "Foundation_NSArray")]
        #[method(showAnnotations:animated:)]
        pub unsafe fn showAnnotations_animated(
            &self,
            annotations: &NSArray<ProtocolObject<dyn MKAnnotation>>,
            animated: bool,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSView`
    #[cfg(feature = "MapKit_MKMapView")]
    unsafe impl MKMapView {
        #[method_id(@__retain_semantics Init initWithFrame:)]
        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Id<Self>;

        #[cfg(feature = "Foundation_NSCoder")]
        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Option<Id<Self>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSResponder`
    #[cfg(feature = "MapKit_MKMapView")]
    unsafe impl MKMapView {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "MapKit_MKMapView")]
    unsafe impl MKMapView {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
    }
);

extern_methods!(
    /// OverlaysAPI
    #[cfg(feature = "MapKit_MKMapView")]
    unsafe impl MKMapView {
        #[method(addOverlay:level:)]
        pub unsafe fn addOverlay_level(
            &self,
            overlay: &ProtocolObject<dyn MKOverlay>,
            level: MKOverlayLevel,
        );

        #[cfg(feature = "Foundation_NSArray")]
        #[method(addOverlays:level:)]
        pub unsafe fn addOverlays_level(
            &self,
            overlays: &NSArray<ProtocolObject<dyn MKOverlay>>,
            level: MKOverlayLevel,
        );

        #[method(removeOverlay:)]
        pub unsafe fn removeOverlay(&self, overlay: &ProtocolObject<dyn MKOverlay>);

        #[cfg(feature = "Foundation_NSArray")]
        #[method(removeOverlays:)]
        pub unsafe fn removeOverlays(&self, overlays: &NSArray<ProtocolObject<dyn MKOverlay>>);

        #[method(insertOverlay:atIndex:level:)]
        pub unsafe fn insertOverlay_atIndex_level(
            &self,
            overlay: &ProtocolObject<dyn MKOverlay>,
            index: NSUInteger,
            level: MKOverlayLevel,
        );

        #[method(insertOverlay:aboveOverlay:)]
        pub unsafe fn insertOverlay_aboveOverlay(
            &self,
            overlay: &ProtocolObject<dyn MKOverlay>,
            sibling: &ProtocolObject<dyn MKOverlay>,
        );

        #[method(insertOverlay:belowOverlay:)]
        pub unsafe fn insertOverlay_belowOverlay(
            &self,
            overlay: &ProtocolObject<dyn MKOverlay>,
            sibling: &ProtocolObject<dyn MKOverlay>,
        );

        #[method(exchangeOverlay:withOverlay:)]
        pub unsafe fn exchangeOverlay_withOverlay(
            &self,
            overlay1: &ProtocolObject<dyn MKOverlay>,
            overlay2: &ProtocolObject<dyn MKOverlay>,
        );

        #[cfg(feature = "Foundation_NSArray")]
        #[method_id(@__retain_semantics Other overlays)]
        pub unsafe fn overlays(&self) -> Id<NSArray<ProtocolObject<dyn MKOverlay>>>;

        #[cfg(feature = "Foundation_NSArray")]
        #[method_id(@__retain_semantics Other overlaysInLevel:)]
        pub unsafe fn overlaysInLevel(
            &self,
            level: MKOverlayLevel,
        ) -> Id<NSArray<ProtocolObject<dyn MKOverlay>>>;

        #[cfg(feature = "MapKit_MKOverlayRenderer")]
        #[method_id(@__retain_semantics Other rendererForOverlay:)]
        pub unsafe fn rendererForOverlay(
            &self,
            overlay: &ProtocolObject<dyn MKOverlay>,
        ) -> Option<Id<MKOverlayRenderer>>;

        #[method(addOverlay:)]
        pub unsafe fn addOverlay(&self, overlay: &ProtocolObject<dyn MKOverlay>);

        #[cfg(feature = "Foundation_NSArray")]
        #[method(addOverlays:)]
        pub unsafe fn addOverlays(&self, overlays: &NSArray<ProtocolObject<dyn MKOverlay>>);

        #[method(insertOverlay:atIndex:)]
        pub unsafe fn insertOverlay_atIndex(
            &self,
            overlay: &ProtocolObject<dyn MKOverlay>,
            index: NSUInteger,
        );

        #[method(exchangeOverlayAtIndex:withOverlayAtIndex:)]
        pub unsafe fn exchangeOverlayAtIndex_withOverlayAtIndex(
            &self,
            index1: NSUInteger,
            index2: NSUInteger,
        );
    }
);

extern_protocol!(
    pub unsafe trait MKMapViewDelegate: NSObjectProtocol {
        #[cfg(feature = "MapKit_MKMapView")]
        #[optional]
        #[method(mapView:regionWillChangeAnimated:)]
        unsafe fn mapView_regionWillChangeAnimated(&self, map_view: &MKMapView, animated: bool);

        #[cfg(feature = "MapKit_MKMapView")]
        #[optional]
        #[method(mapView:regionDidChangeAnimated:)]
        unsafe fn mapView_regionDidChangeAnimated(&self, map_view: &MKMapView, animated: bool);

        #[cfg(feature = "MapKit_MKMapView")]
        #[optional]
        #[method(mapViewDidChangeVisibleRegion:)]
        unsafe fn mapViewDidChangeVisibleRegion(&self, map_view: &MKMapView);

        #[cfg(feature = "MapKit_MKMapView")]
        #[optional]
        #[method(mapViewWillStartLoadingMap:)]
        unsafe fn mapViewWillStartLoadingMap(&self, map_view: &MKMapView);

        #[cfg(feature = "MapKit_MKMapView")]
        #[optional]
        #[method(mapViewDidFinishLoadingMap:)]
        unsafe fn mapViewDidFinishLoadingMap(&self, map_view: &MKMapView);

        #[cfg(all(feature = "Foundation_NSError", feature = "MapKit_MKMapView"))]
        #[optional]
        #[method(mapViewDidFailLoadingMap:withError:)]
        unsafe fn mapViewDidFailLoadingMap_withError(&self, map_view: &MKMapView, error: &NSError);

        #[cfg(feature = "MapKit_MKMapView")]
        #[optional]
        #[method(mapViewWillStartRenderingMap:)]
        unsafe fn mapViewWillStartRenderingMap(&self, map_view: &MKMapView);

        #[cfg(feature = "MapKit_MKMapView")]
        #[optional]
        #[method(mapViewDidFinishRenderingMap:fullyRendered:)]
        unsafe fn mapViewDidFinishRenderingMap_fullyRendered(
            &self,
            map_view: &MKMapView,
            fully_rendered: bool,
        );

        #[cfg(all(feature = "MapKit_MKAnnotationView", feature = "MapKit_MKMapView"))]
        #[optional]
        #[method_id(@__retain_semantics Other mapView:viewForAnnotation:)]
        unsafe fn mapView_viewForAnnotation(
            &self,
            map_view: &MKMapView,
            annotation: &ProtocolObject<dyn MKAnnotation>,
        ) -> Option<Id<MKAnnotationView>>;

        #[cfg(all(
            feature = "Foundation_NSArray",
            feature = "MapKit_MKAnnotationView",
            feature = "MapKit_MKMapView"
        ))]
        #[optional]
        #[method(mapView:didAddAnnotationViews:)]
        unsafe fn mapView_didAddAnnotationViews(
            &self,
            map_view: &MKMapView,
            views: &NSArray<MKAnnotationView>,
        );

        #[cfg(all(feature = "MapKit_MKAnnotationView", feature = "MapKit_MKMapView"))]
        #[optional]
        #[method(mapView:didSelectAnnotationView:)]
        unsafe fn mapView_didSelectAnnotationView(
            &self,
            map_view: &MKMapView,
            view: &MKAnnotationView,
        );

        #[cfg(all(feature = "MapKit_MKAnnotationView", feature = "MapKit_MKMapView"))]
        #[optional]
        #[method(mapView:didDeselectAnnotationView:)]
        unsafe fn mapView_didDeselectAnnotationView(
            &self,
            map_view: &MKMapView,
            view: &MKAnnotationView,
        );

        #[cfg(feature = "MapKit_MKMapView")]
        #[optional]
        #[method(mapView:didSelectAnnotation:)]
        unsafe fn mapView_didSelectAnnotation(
            &self,
            map_view: &MKMapView,
            annotation: &ProtocolObject<dyn MKAnnotation>,
        );

        #[cfg(feature = "MapKit_MKMapView")]
        #[optional]
        #[method(mapView:didDeselectAnnotation:)]
        unsafe fn mapView_didDeselectAnnotation(
            &self,
            map_view: &MKMapView,
            annotation: &ProtocolObject<dyn MKAnnotation>,
        );

        #[cfg(feature = "MapKit_MKMapView")]
        #[optional]
        #[method(mapViewWillStartLocatingUser:)]
        unsafe fn mapViewWillStartLocatingUser(&self, map_view: &MKMapView);

        #[cfg(feature = "MapKit_MKMapView")]
        #[optional]
        #[method(mapViewDidStopLocatingUser:)]
        unsafe fn mapViewDidStopLocatingUser(&self, map_view: &MKMapView);

        #[cfg(all(feature = "MapKit_MKMapView", feature = "MapKit_MKUserLocation"))]
        #[optional]
        #[method(mapView:didUpdateUserLocation:)]
        unsafe fn mapView_didUpdateUserLocation(
            &self,
            map_view: &MKMapView,
            user_location: &MKUserLocation,
        );

        #[cfg(all(feature = "Foundation_NSError", feature = "MapKit_MKMapView"))]
        #[optional]
        #[method(mapView:didFailToLocateUserWithError:)]
        unsafe fn mapView_didFailToLocateUserWithError(
            &self,
            map_view: &MKMapView,
            error: &NSError,
        );

        #[cfg(all(feature = "MapKit_MKAnnotationView", feature = "MapKit_MKMapView"))]
        #[optional]
        #[method(mapView:annotationView:didChangeDragState:fromOldState:)]
        unsafe fn mapView_annotationView_didChangeDragState_fromOldState(
            &self,
            map_view: &MKMapView,
            view: &MKAnnotationView,
            new_state: MKAnnotationViewDragState,
            old_state: MKAnnotationViewDragState,
        );

        #[cfg(feature = "MapKit_MKMapView")]
        #[optional]
        #[method(mapView:didChangeUserTrackingMode:animated:)]
        unsafe fn mapView_didChangeUserTrackingMode_animated(
            &self,
            map_view: &MKMapView,
            mode: MKUserTrackingMode,
            animated: bool,
        );

        #[cfg(all(feature = "MapKit_MKMapView", feature = "MapKit_MKOverlayRenderer"))]
        #[optional]
        #[method_id(@__retain_semantics Other mapView:rendererForOverlay:)]
        unsafe fn mapView_rendererForOverlay(
            &self,
            map_view: &MKMapView,
            overlay: &ProtocolObject<dyn MKOverlay>,
        ) -> Id<MKOverlayRenderer>;

        #[cfg(all(
            feature = "Foundation_NSArray",
            feature = "MapKit_MKMapView",
            feature = "MapKit_MKOverlayRenderer"
        ))]
        #[optional]
        #[method(mapView:didAddOverlayRenderers:)]
        unsafe fn mapView_didAddOverlayRenderers(
            &self,
            map_view: &MKMapView,
            renderers: &NSArray<MKOverlayRenderer>,
        );

        #[cfg(all(
            feature = "Foundation_NSArray",
            feature = "MapKit_MKClusterAnnotation",
            feature = "MapKit_MKMapView"
        ))]
        #[optional]
        #[method_id(@__retain_semantics Other mapView:clusterAnnotationForMemberAnnotations:)]
        unsafe fn mapView_clusterAnnotationForMemberAnnotations(
            &self,
            map_view: &MKMapView,
            member_annotations: &NSArray<ProtocolObject<dyn MKAnnotation>>,
        ) -> Id<MKClusterAnnotation>;
    }

    unsafe impl ProtocolType for dyn MKMapViewDelegate {}
);