If i create an instance of mapView in MainView, how can i use that instance in Container View?
class MainView: UIViewController {
var mapView = MapView()
}
class ContainerView: UIViewController {
MainView.mapView.changeCameraPosition()
}
How can i access this mapView instance in container View or is it possible?
The solution i found and also with help from Burnsi and Rob is to pass the instance as an object when adding view controller to container view:
And i also changed the class type of the Container View and Main View in NextPageVC to PassthruView so that users can interact with the map when Container View Controller is on top: