SceneDelegate 사용하지 않고 개발하기
2020. 6. 30. 17:01ㆍ개발자료/iOS
반응형
● Swift
1. SceneDelegate.swift 파일 삭제
2. AppDelegate.swift 코드 추가
var window: UIWindow?
3. AppDelegate.swift 함수 제거
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
4. info.plist Property 삭제
Application Scene Manifest
● Objective-C
1. SceneDelegate.h, SceneDelegate.m 파일 삭제
2. AppDelegate.h 코드 추가
@property (nonatomic, strong) UIWindow *window
;
3. AppDelegate.m 함수 삭제
#pragma mark - UISceneSession lifecycle
- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role];
}
- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *)sceneSessions {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
4. info.plist Property 삭제
Application Scene Manifest
반응형
'개발자료 > iOS' 카테고리의 다른 글
[Swift] 변수, 상수 (0) | 2020.08.09 |
---|---|
Xcode11 SceneDelegate 제거하지 않고 iOS13 이하버전 호환하기 (0) | 2020.07.01 |
iOS 시뮬레이터 다크모드 설정 (0) | 2020.06.30 |
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=armv7s, VALID_ARCHS=armv7) (0) | 2020.05.21 |
Xcode 10 에서 libstdc++ 오류 관련 (0) | 2020.05.21 |