简体   繁体   English

如何从其他ViewController访问MapView实例? (MapBox,Swift)

[英]How to access MapView Instance from other ViewController? (MapBox, Swift)

I am using a ContainerView within my MapViewController , which should be able to trigger the MapView in the MapViewController for a zooming-method. 我在MapViewController使用了ContainerView ,它应该能够触发MapViewControllerMapView以获取缩放方法。 How can I reference the MapView to manipulate it? 如何引用MapView进行操作? I did not find any method whatsoever, Android seems to have getMapAsync . 我没有找到任何方法,Android似乎有getMapAsync

通过在MapViewController中实现一个协议并在PageViewController中设置一个委托,我设法解决了该问题(基本上是两个不同ViewController之间的通信)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在swift中从另一个访问Viewcontroller的实例 - Access the instance of a Viewcontroller from another in swift 如何从ViewController访问Swift 3中的另一个viewController - How to access from viewController another viewController in Swift 3 如何在Swift上从MapView传递解析的PFUser到另一个ViewController? - How to pass (grab) a Parse `PFUser` from `MapView` to another `ViewController` on Swift? 无法在Swift中的其他ViewController中为ViewController创建实例 - Not able to create instance for viewcontroller in other viewcontrollers in Swift 如何通过单击按钮在 swift 中显示来自其他 viewController Class 的视图 - How to show a view from other viewController Class in swift with button click 从Swift中的AppDelegate获取ViewController的实例 - Get Instance Of ViewController From AppDelegate In Swift Swift:如何从Singleton类访问ViewController中的CollectionView - Swift: How to access CollectionView which is present in ViewController from a Singleton Class 如何从GameScene快速访问ViewController中的整数变量 - how to access integer variable from GameScene to ViewController in swift 如何从另一个 ViewController (Swift) 访问 UITextField 中的文本? - How do I access text in UITextField from another ViewController (Swift)? Mapbox iOS8 Swift mapView.showUsersLocation - Mapbox iOS8 Swift mapView.showUsersLocation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM