Cocoa touch 像iOS7 Apple Maps中的MKMapView夜间模式?

Cocoa touch 像iOS7 Apple Maps中的MKMapView夜间模式?,cocoa-touch,mkmapview,mapkit,Cocoa Touch,Mkmapview,Mapkit,在MKMapView上启用夜间模式是否有一种简单的方法,就像苹果地图应用程序在日落时所做的那样 我在MapKit文档中没有找到这样的东西 不,您必须使用像或这样的第三方库 不幸的是,它是一个私有api: //add this above the interface of the class you want to try it on @interface MKMapView () -(void) _setShowsNightMode:(BOOL)yesOrNo; @end //call

MKMapView
上启用夜间模式是否有一种简单的方法,就像苹果地图应用程序在日落时所做的那样


我在MapKit文档中没有找到这样的东西

不,您必须使用像或这样的第三方库

不幸的是,它是一个私有api:

//add this above the interface of the class you want to try it on
@interface MKMapView ()
   -(void) _setShowsNightMode:(BOOL)yesOrNo;
@end

//call this in your viewDidLoad or somewhere else appropriate
[self.mapView _setShowsNightMode:YES];

我们应该为苹果公司设立一个雷达,让它向所有人开放。对于在第三方应用程序中使用地图的人来说,这可能是一个安全问题如果您尝试使用此

将应用提交到应用商店,您的应用将被拒绝。这可能是一个更好的答案,因为简短的答案是“否”。使用私人API是不可接受的。swift中是否提供相同的API?似乎无法让这个工作。