ios - How to lock the orientation of a specific View Controller to Portrait mode? -
i hope well!
i working on swift 2 app using xcode ios 9! , whole app rotate on both directions expect particular view controller want locked portrait when user rotates. tried hours , looked lot online , nothing worked. help? update: tried 2 methods below doesn't work ios 9 :( please help
best, anas
objective c :
nsnumber *orientationvalue = [nsnumber numberwithint:uiinterfaceorientationportrait]; [[uidevice currentdevice] setvalue:orientationvalue forkey:@"orientation"];
swift :
let orientationvalue = uiinterfaceorientation.portrait.rawvalue uidevice.currentdevice().setvalue(orientationvalue, forkey: "orientation")
Comments
Post a Comment