Swift 2.3: Solution to move only the Location Button. I am using pod 'GoogleMaps', '~> 2.1'.
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 to get the Class Name.
extension NSObject {
var theClassName: String {
return NSStringFromClass(self.dynamicType)
}
}
I will update this code to Swift 3.0 as soon as possible. :)
Swift 4.0:
public extension NSObject {
public var theClassName: String {
return NSStringFromClass(type(of: self))
}
}