How do I change the compass location on a google map view using swift?
Answers on Stack Overflow are absurdly outdated. Please help! I asked this question a while ago but no one answered. I'm exhausted, my attempts at a solution have all failed, and my self esteem is at an all time low.
Previous answers here:
How to change myLocationButton position from a GMSMapView?
Moving the google maps compass
My Attempt:
//move position on google compass
for object in mapView!.subviews {
if object.theClassName == "GMSUISettingsView" {
for view in object.subviews {
if view.theClassName == "GMSx_QTMButton" {
var frame = view.frame
frame.origin.y = frame.origin.y - 110 // Move the button 110 up
view.frame = frame
}
}
}
}
extension:
extension NSObject {
var theClassName: String {
return NSStringFromClass(type(of: self))
}
}