From b63a7d2f008b114b739bb93c74f64c8c935c3f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EB=8F=99=EC=98=81?= Date: Fri, 1 Jan 2021 19:58:24 +0900 Subject: [PATCH] =?UTF-8?q?:sparkles:=20Splash=20=ED=99=94=EB=A9=B4=20?= =?UTF-8?q?=EB=85=B8=EC=B6=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dear-World.xcodeproj/project.pbxproj | 4 ---- .../Scene/Main/MainTabBarController.swift | 18 +++++++++++++++ .../Scene/Splash/SplashReactor.swift | 22 ------------------- .../Scene/Splash/SplashViewController.swift | 4 +++- 4 files changed, 21 insertions(+), 27 deletions(-) delete mode 100644 Dear-World/Dear-World/Source/Presentation/Scene/Splash/SplashReactor.swift diff --git a/Dear-World/Dear-World.xcodeproj/project.pbxproj b/Dear-World/Dear-World.xcodeproj/project.pbxproj index 38a0850..d953dfc 100644 --- a/Dear-World/Dear-World.xcodeproj/project.pbxproj +++ b/Dear-World/Dear-World.xcodeproj/project.pbxproj @@ -35,7 +35,6 @@ 395826332596E693007325AB /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 395826322596E693007325AB /* Logger.swift */; }; 395A4177259DF9F900F10531 /* MainTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 395A4176259DF9F900F10531 /* MainTabBarController.swift */; }; 39658F8D259AD9900050D180 /* SplashViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39658F8C259AD9900050D180 /* SplashViewController.swift */; }; - 39658F92259AD9B70050D180 /* SplashReactor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39658F91259AD9B70050D180 /* SplashReactor.swift */; }; 39658F9B259ADB130050D180 /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = 39658F9A259ADB130050D180 /* Lottie */; }; 39658FA0259ADE770050D180 /* splash_1x.json in Resources */ = {isa = PBXBuildFile; fileRef = 39658F9F259ADE770050D180 /* splash_1x.json */; }; 39658FAF259AE4E40050D180 /* World.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39658FAE259AE4E40050D180 /* World.swift */; }; @@ -120,7 +119,6 @@ 395826322596E693007325AB /* Logger.swift */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = ""; tabWidth = 2; }; 395A4176259DF9F900F10531 /* MainTabBarController.swift */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = MainTabBarController.swift; sourceTree = ""; tabWidth = 2; }; 39658F8C259AD9900050D180 /* SplashViewController.swift */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = SplashViewController.swift; sourceTree = ""; tabWidth = 2; }; - 39658F91259AD9B70050D180 /* SplashReactor.swift */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = SplashReactor.swift; sourceTree = ""; tabWidth = 2; }; 39658F9F259ADE770050D180 /* splash_1x.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = splash_1x.json; sourceTree = ""; }; 39658FAE259AE4E40050D180 /* World.swift */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = World.swift; sourceTree = ""; tabWidth = 2; }; 39658FB5259AE5250050D180 /* World.API.Rank.swift */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = World.API.Rank.swift; sourceTree = ""; tabWidth = 2; }; @@ -434,7 +432,6 @@ isa = PBXGroup; children = ( 39658F8C259AD9900050D180 /* SplashViewController.swift */, - 39658F91259AD9B70050D180 /* SplashReactor.swift */, ); path = Splash; sourceTree = ""; @@ -717,7 +714,6 @@ 39658FAF259AE4E40050D180 /* World.swift in Sources */, 3971EB24259A7C420084E6DC /* Emoji.Model.Random.swift in Sources */, 39F0C1632597B34F00A7001F /* UIView+.swift in Sources */, - 39658F92259AD9B70050D180 /* SplashReactor.swift in Sources */, 3971EB1F259A7C0E0084E6DC /* Emoji.API.Random.swift in Sources */, 3902F1052596F26D00A3DF8C /* CheeringMapViewController.swift in Sources */, 39F0C1B72598927C00A7001F /* ErrorView.swift in Sources */, diff --git a/Dear-World/Dear-World/Source/Presentation/Scene/Main/MainTabBarController.swift b/Dear-World/Dear-World/Source/Presentation/Scene/Main/MainTabBarController.swift index fb34888..1923c4d 100644 --- a/Dear-World/Dear-World/Source/Presentation/Scene/Main/MainTabBarController.swift +++ b/Dear-World/Dear-World/Source/Presentation/Scene/Main/MainTabBarController.swift @@ -9,6 +9,8 @@ import UIKit final class MainTabBarController: UITabBarController { + private var isFirstLaunch: Bool = true + override func viewDidLoad() { super.viewDidLoad() @@ -16,6 +18,22 @@ final class MainTabBarController: UITabBarController { self.delegate = self } + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + if isFirstLaunch { + isFirstLaunch = false + presentSplashViewController() + } + } + + private func presentSplashViewController() { + let splashViewController: UIViewController = SplashViewController().then { + $0.modalPresentationStyle = .fullScreen + } + self.present(splashViewController, animated: false, completion: nil) + } + private func setupTabBar() { let discoverViewController: UIViewController = DiscoverViewController().then { $0.tabBarItem.image = UIImage(named: "message_default")? diff --git a/Dear-World/Dear-World/Source/Presentation/Scene/Splash/SplashReactor.swift b/Dear-World/Dear-World/Source/Presentation/Scene/Splash/SplashReactor.swift deleted file mode 100644 index 6b22574..0000000 --- a/Dear-World/Dear-World/Source/Presentation/Scene/Splash/SplashReactor.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// SplashReactor.swift -// Dear-World -// -// Created by dongyoung.lee on 2020/12/29. -// - -import Foundation -import ReactorKit - -final class SplashReactor: Reactor { - enum Action { - case entry - } - - struct State { - let lottie: String = "" - } - - let initialState: State = State() - -} diff --git a/Dear-World/Dear-World/Source/Presentation/Scene/Splash/SplashViewController.swift b/Dear-World/Dear-World/Source/Presentation/Scene/Splash/SplashViewController.swift index d24d233..7007da1 100644 --- a/Dear-World/Dear-World/Source/Presentation/Scene/Splash/SplashViewController.swift +++ b/Dear-World/Dear-World/Source/Presentation/Scene/Splash/SplashViewController.swift @@ -34,6 +34,8 @@ final class SplashViewController: UIViewController { $0.edges.equalToSuperview() $0.center.equalToSuperview() } - animationView.play() + animationView.play { [weak self] _ in + self?.dismiss(animated: false, completion: nil) + } } }