From 76b0d096d2bc6d364b391e7e24f9dc51f0f2791c Mon Sep 17 00:00:00 2001 From: iOS-Yetti Date: Mon, 28 Aug 2023 19:11:48 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=BD=94=EB=93=9C=EB=B2=A0=EC=9D=B4?= =?UTF-8?q?=EC=8A=A4=EB=A1=9C=20UI=EB=A5=BC=20=EC=9E=91=EC=84=B1=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20=EC=9C=84=ED=95=B4=20=EC=8A=A4=ED=86=A0=EB=A6=AC?= =?UTF-8?q?=EB=B3=B4=EB=93=9C=20=EC=82=AD=EC=A0=9C=20=EB=B0=8F=20SceneDele?= =?UTF-8?q?gate=EC=97=90=20rootViewController=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Diary.xcodeproj/project.pbxproj | 14 -------------- Diary/AppDelegate.swift | 4 +--- Diary/Base.lproj/Main.storyboard | 24 ------------------------ Diary/Info.plist | 2 -- Diary/SceneDelegate.swift | 14 ++++++++------ Diary/ViewController.swift | 5 +---- 6 files changed, 10 insertions(+), 53 deletions(-) delete mode 100644 Diary/Base.lproj/Main.storyboard diff --git a/Diary.xcodeproj/project.pbxproj b/Diary.xcodeproj/project.pbxproj index da144935d..63e972788 100644 --- a/Diary.xcodeproj/project.pbxproj +++ b/Diary.xcodeproj/project.pbxproj @@ -10,7 +10,6 @@ C739AE25284DF28600741E8F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C739AE24284DF28600741E8F /* AppDelegate.swift */; }; C739AE27284DF28600741E8F /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C739AE26284DF28600741E8F /* SceneDelegate.swift */; }; C739AE29284DF28600741E8F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C739AE28284DF28600741E8F /* ViewController.swift */; }; - C739AE2C284DF28600741E8F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C739AE2A284DF28600741E8F /* Main.storyboard */; }; C739AE2F284DF28600741E8F /* Diary.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = C739AE2D284DF28600741E8F /* Diary.xcdatamodeld */; }; C739AE31284DF28600741E8F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C739AE30284DF28600741E8F /* Assets.xcassets */; }; C739AE34284DF28600741E8F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C739AE32284DF28600741E8F /* LaunchScreen.storyboard */; }; @@ -21,7 +20,6 @@ C739AE24284DF28600741E8F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; C739AE26284DF28600741E8F /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; C739AE28284DF28600741E8F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - C739AE2B284DF28600741E8F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; C739AE2E284DF28600741E8F /* Diary.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Diary.xcdatamodel; sourceTree = ""; }; C739AE30284DF28600741E8F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; C739AE33284DF28600741E8F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; @@ -61,7 +59,6 @@ C739AE24284DF28600741E8F /* AppDelegate.swift */, C739AE26284DF28600741E8F /* SceneDelegate.swift */, C739AE28284DF28600741E8F /* ViewController.swift */, - C739AE2A284DF28600741E8F /* Main.storyboard */, C739AE30284DF28600741E8F /* Assets.xcassets */, C739AE32284DF28600741E8F /* LaunchScreen.storyboard */, C739AE35284DF28600741E8F /* Info.plist */, @@ -130,7 +127,6 @@ files = ( C739AE34284DF28600741E8F /* LaunchScreen.storyboard in Resources */, C739AE31284DF28600741E8F /* Assets.xcassets in Resources */, - C739AE2C284DF28600741E8F /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -151,14 +147,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ - C739AE2A284DF28600741E8F /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C739AE2B284DF28600741E8F /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; C739AE32284DF28600741E8F /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -297,7 +285,6 @@ INFOPLIST_FILE = Diary/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; @@ -325,7 +312,6 @@ INFOPLIST_FILE = Diary/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; diff --git a/Diary/AppDelegate.swift b/Diary/AppDelegate.swift index 7efc2f7c0..f9b5a8a4b 100644 --- a/Diary/AppDelegate.swift +++ b/Diary/AppDelegate.swift @@ -8,9 +8,7 @@ import UIKit import CoreData @main -class AppDelegate: UIResponder, UIApplicationDelegate { - - +final class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. diff --git a/Diary/Base.lproj/Main.storyboard b/Diary/Base.lproj/Main.storyboard deleted file mode 100644 index 25a763858..000000000 --- a/Diary/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Diary/Info.plist b/Diary/Info.plist index dd3c9afda..0eb786dc1 100644 --- a/Diary/Info.plist +++ b/Diary/Info.plist @@ -15,8 +15,6 @@ Default Configuration UISceneDelegateClassName $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main diff --git a/Diary/SceneDelegate.swift b/Diary/SceneDelegate.swift index c739cbc38..a3ba9636e 100644 --- a/Diary/SceneDelegate.swift +++ b/Diary/SceneDelegate.swift @@ -6,16 +6,18 @@ import UIKit -class SceneDelegate: UIResponder, UIWindowSceneDelegate { +final class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? - func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. - // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. - // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). - guard let _ = (scene as? UIWindowScene) else { return } + guard let windowScene = (scene as? UIWindowScene) else { return } + window = UIWindow(windowScene: windowScene) + let mainViewController: ViewController = ViewController() + + let navigationController = UINavigationController(rootViewController: mainViewController) + window?.rootViewController = navigationController + window?.makeKeyAndVisible() } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Diary/ViewController.swift b/Diary/ViewController.swift index dd724e13a..d56ea716d 100644 --- a/Diary/ViewController.swift +++ b/Diary/ViewController.swift @@ -6,13 +6,10 @@ import UIKit -class ViewController: UIViewController { +final class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - // Do any additional setup after loading the view. } - - }