在OC下写这个真方便。。
- (NSInteger) supportedInterfaceOrientations{
     return (UIInterfaceOrientationsMaskPortrait | UIInterfaceOrientationsMaskLandscapeLeft);
}
在swift下就。。苦逼了
override func supportedInterfaceOrientations -> Int{
     //错误写法 return (UIInterfaceOrientationsMask.Portrait | UIInterfaceOrientationsMask.LandscapeLeft);
     //上面会报错。。说是UIInterfaceOrientationsMask不能转成Bool
     //google了一下,原来,,,应该这样写
     return UIInterfaceOrientationMask.Portrait.rawValue.hashValue | UIInterfaceOrientationMask.PortraitUpsideDown.rawValue.hashValue;
}
天啊要写这么上。开始网上是写UIInterfaceOrientationMask.Portrait.toRaw().hashValue,但好象toRaw的方法新版没有了。
所以只能用rawValue来转换。
好辛苦啊。swift改了N次了
 
