0

My google mapView is not rotating according to my device orientation. Wondering how can I make it rotate accordingly?

I'm using the following to detect orientation changes. The landscape is being detected but I want to be able to make the map rotate too. Any help is appreciated, thanks!

NotificationCenter.default.addObserver(self, selector: #selector(ViewController.rotated), name: UIDevice.orientationDidChangeNotification, object: nil)

@objc func rotated() {
        if UIDevice.current.orientation.isLandscape {
            print("Landscape orientation")
        } else {
            print("Portrait orientation")
        }
    }

enter image description here

Plle02
  • 33
  • 6

0 Answers0