[UIKit] 가로/세로 방향 고정

2022. 7. 20. 01:20SWIFT/UIKit

728x90
반응형

General에서 Device Orientation을 체크해줬지만 고정이 안된다

 

그래서 코드로 나타냄

AppDelegate 에서 메소드 추가해주면 고정완료

landscape = 가로

//가로세로 고정!
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
    return UIInterfaceOrientationMask.landscape
}

 

728x90
반응형