apple/iOS, UIKit, Documentation
[iOS] rootViewController 교체하기
lgvv
2022. 8. 10. 03:19
rootViewController 교체하기
✅ 아래 코드를 작성시 warning 발생
warning: 'windows' was deprecated in iOS 15.0: Use UIWindowScene.windows on a relevant window scene instead
UIApplication.shared.windows.first!.rootViewController = viewController
✅ 대체 가능한 코드
view.window?.rootViewController = viewController