'Place button over google map view
I am trying to display a button on top of my Google Map View on iOS. I am using Xcode and have tried the following code:
let mapView = GMSMapView()
override func loadView(){
view = mapView
do{
if let styleURL = Bundle.main.url(forResource: "style", withExtension: "json"){
mapView.mapStyle = try GMSMapStyle(contentsOfFileURL: styleURL)
}
} catch {
}
let marker = GMSMarker()
marker.position = CLLocationCoordinate2D(latitude: 45.45, longitude: -73.6)
marker.title = "Montreal"
marker.snippet = "Canada"
marker.map = mapView
onMapReady()
}
I do not see any button when the map loads. This is what the storyboard looks like:
Here are the constraints: enter image description here
How would I get this button to appear?
Solution 1:[1]
parentView.bringSubviewToFront(childView)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | novice |
