Vishnu
Vishnu

Reputation: 56

Forcing user to rotate the screen to landscape (iOS)

I am trying to develop a video player application. In which when user clicks on the video it will start play in landscape mode. in the situation i am forcing user to rotate the screen. Is this is against iOS UI guidelines. Because of this am i gona face any problem in app review.Please guide me.

Upvotes: 1

Views: 561

Answers (1)

Jaydeep Vora
Jaydeep Vora

Reputation: 6223

Swift 3.0

Add this in the viewDidLoad():

 let value =  UIInterfaceOrientation.landscapeLeft.rawValue
 UIDevice.current.setValue(value, forKey: "orientation")

And,

override func shouldAutorotate() -> Bool {
    return true
}

Upvotes: 2

Related Questions