I get the following error message:
A view can only be associated with at most one view controller at a time!
Is it possible to add the same view to two different view controllers?
I want to add one instance of a Google Map to a Tab View Controller.
I'm using swift4 with the storyboards.
If it were a typical view then you should create an XIB and add a new instance of it to each view. Since you're using GMSMapView from the Google Maps SDK, and you want to have the same instance across multiple tabs the approach will be different.
You can either:
addSubview()
to move it around. Basically use addSubview()
in the new tab to remove it from the old one and add it to the new one.