Reputation: 1504
I have application for iPhone's and iPad. However, for iPad I have to force it for landscape only and for iPhone I have no restrictions.
As I understand such solution can not be done via device orientation property in project properties, which I have to choice all for iPhone, and have to be via code.
I am a new one in Swift and will glad to get some explanations.
Upvotes: 0
Views: 101
Reputation: 100503
You can try something like
if(UIDevice.currentDevice().userInterfaceIdiom == .Pad){
let value = UIInterfaceOrientation.LandscapeRight.rawValue
UIDevice.currentDevice().setValue(value, forKey: "orientation")
}
Upvotes: 1