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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -