diff --git a/iBox/Resources/iBox.xcdatamodeld/iBox.xcdatamodel/contents b/iBox/Resources/iBox.xcdatamodeld/iBox.xcdatamodel/contents index c40ccfd..16ddc4f 100644 --- a/iBox/Resources/iBox.xcdatamodeld/iBox.xcdatamodel/contents +++ b/iBox/Resources/iBox.xcdatamodeld/iBox.xcdatamodel/contents @@ -8,7 +8,6 @@ - diff --git a/iBox/Sources/AppDelegate.swift b/iBox/Sources/AppDelegate.swift index e52e659..151f061 100644 --- a/iBox/Sources/AppDelegate.swift +++ b/iBox/Sources/AppDelegate.swift @@ -14,10 +14,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + Task { + preloadFavoriteWeb() + } + versioningHandler.checkAppVersion { result in AppStateManager.shared.isVersionCheckCompleted = result } - preloadFavoriteWeb() return true } diff --git a/iBox/Sources/BoxList/FolderButton.swift b/iBox/Sources/BoxList/FolderButton.swift index d584bad..c20639c 100644 --- a/iBox/Sources/BoxList/FolderButton.swift +++ b/iBox/Sources/BoxList/FolderButton.swift @@ -79,10 +79,6 @@ class FolderButton: UIButton { folderNameLabel.text = name } -// func setFolderColor(_ color: UIColor) { -// folderImageView.tintColor = color -// } - func toggleStatus() { isOpen = !isOpen openCloseImageView.image = isOpen ? UIImage(systemName: "chevron.up") : UIImage(systemName: "chevron.down") diff --git a/iBox/Sources/Favorite/FavoriteViewController.swift b/iBox/Sources/Favorite/FavoriteViewController.swift index 0007815..7d2e018 100644 --- a/iBox/Sources/Favorite/FavoriteViewController.swift +++ b/iBox/Sources/Favorite/FavoriteViewController.swift @@ -16,10 +16,6 @@ class FavoriteViewController: BaseViewController, BaseViewControll setupNavigationBar() } - override func viewDidDisappear(_ animated: Bool) { - WebViewPreloader.shared.resetFavoriteView() - } - // MARK: - BaseViewControllerProtocol func setupNavigationBar() { diff --git a/iBox/Sources/Main/MainTabBarController.swift b/iBox/Sources/Main/MainTabBarController.swift index a5564be..6f6404b 100644 --- a/iBox/Sources/Main/MainTabBarController.swift +++ b/iBox/Sources/Main/MainTabBarController.swift @@ -9,10 +9,13 @@ import UIKit class MainTabBarController: UITabBarController { + var previousTabIndex = 0 + // MARK: - Life Cycle override func viewDidLoad() { super.viewDidLoad() + delegate = self view.backgroundColor = .backgroundColor setupTabBar() @@ -45,3 +48,12 @@ class MainTabBarController: UITabBarController { } } + +extension MainTabBarController: UITabBarControllerDelegate { + func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) { + if tabBarController.selectedIndex == 1 && previousTabIndex == 1 { + WebViewPreloader.shared.resetFavoriteView() + } + previousTabIndex = tabBarController.selectedIndex + } +} diff --git a/iBox/Sources/SceneDelegate.swift b/iBox/Sources/SceneDelegate.swift index 194f154..ccba580 100644 --- a/iBox/Sources/SceneDelegate.swift +++ b/iBox/Sources/SceneDelegate.swift @@ -22,7 +22,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { insertDefaultDataIfNeeded() - window?.rootViewController = MainTabBarController() + window?.rootViewController = CustomLaunchScreenViewController() window?.makeKeyAndVisible() // 윈도우를 화면에 보여줌 if let urlContext = connectionOptions.urlContexts.first { diff --git a/iBox/Sources/Shared/CoreDataManager.swift b/iBox/Sources/Shared/CoreDataManager.swift index 524c856..f02bb14 100644 --- a/iBox/Sources/Shared/CoreDataManager.swift +++ b/iBox/Sources/Shared/CoreDataManager.swift @@ -47,7 +47,6 @@ extension CoreDataManager { let newFolder = FolderEntity(context: context) newFolder.id = folder.id newFolder.name = folder.name -// newFolder.color = folder.color.rawValue newFolder.order = lastFolderOrder lastFolderOrder += 1 let bookmarks = NSMutableOrderedSet() @@ -71,7 +70,6 @@ extension CoreDataManager { let newFolder = FolderEntity(context: context) newFolder.id = folder.id newFolder.name = folder.name -// newFolder.color = folder.color.rawValue newFolder.order = lastFolderOrder lastFolderOrder += 1 let bookmarks = NSMutableOrderedSet() @@ -162,10 +160,9 @@ extension CoreDataManager { save() } - func updateFolder(id: UUID, name: String, color: String) { + func updateFolder(id: UUID, name: String) { guard let folder = getFolderEntity(id: id) else { return } folder.name = name - folder.color = color save() }