Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/launch view #151

Merged
merged 6 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions DailyQuest/DailyQuest.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@
9BED4DEC2940EA8900C60631 /* UserImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BED4DEB2940EA8900C60631 /* UserImageView.swift */; };
9BED4DEE2941932200C60631 /* CameraIconView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BED4DED2941932200C60631 /* CameraIconView.swift */; };
9BED4DF12941C47D00C60631 /* RxGesture in Frameworks */ = {isa = PBXBuildFile; productRef = 9BED4DF02941C47D00C60631 /* RxGesture */; };
9BED4DF629470D8C00C60631 /* LaunchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BED4DF529470D8C00C60631 /* LaunchViewController.swift */; };
9BED4DFF2947109D00C60631 /* max.lottie.json in Resources */ = {isa = PBXBuildFile; fileRef = 9BED4DFE2947109C00C60631 /* max.lottie.json */; };
A5003AB4293F5FEC00082A9C /* SignUpViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5003AB3293F5FEC00082A9C /* SignUpViewModel.swift */; };
A5003AB6293F601E00082A9C /* SignUpViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5003AB5293F601E00082A9C /* SignUpViewController.swift */; };
A5003AB9293F909300082A9C /* UserUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5003AB8293F909300082A9C /* UserUseCase.swift */; };
Expand Down Expand Up @@ -355,6 +357,8 @@
9BED4DE9293FA92900C60631 /* UIImageView+.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImageView+.swift"; sourceTree = "<group>"; };
9BED4DEB2940EA8900C60631 /* UserImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserImageView.swift; sourceTree = "<group>"; };
9BED4DED2941932200C60631 /* CameraIconView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraIconView.swift; sourceTree = "<group>"; };
9BED4DF529470D8C00C60631 /* LaunchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchViewController.swift; sourceTree = "<group>"; };
9BED4DFE2947109C00C60631 /* max.lottie.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = max.lottie.json; sourceTree = "<group>"; };
A5003AB3293F5FEC00082A9C /* SignUpViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpViewModel.swift; sourceTree = "<group>"; };
A5003AB5293F601E00082A9C /* SignUpViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpViewController.swift; sourceTree = "<group>"; };
A5003AB8293F909300082A9C /* UserUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserUseCase.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -978,6 +982,7 @@
34ACC337291DE9C100741371 /* LaunchScreen.storyboard */,
34EC71CF292DF0B5004813CB /* GoogleService-Info.plist */,
34ACC33A291DE9C100741371 /* Info.plist */,
9BED4DFE2947109C00C60631 /* max.lottie.json */,
);
path = Resource;
sourceTree = "<group>";
Expand All @@ -1000,6 +1005,7 @@
isa = PBXGroup;
children = (
34FCD368293DEED600E0DC8A /* FriendViewController.swift */,
9BED4DF529470D8C00C60631 /* LaunchViewController.swift */,
);
path = ViewController;
sourceTree = "<group>";
Expand Down Expand Up @@ -1313,6 +1319,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9BED4DFF2947109D00C60631 /* max.lottie.json in Resources */,
34ACC339291DE9C100741371 /* LaunchScreen.storyboard in Resources */,
34ACC336291DE9C100741371 /* Assets.xcassets in Resources */,
34EC71D0292DF0B5004813CB /* GoogleService-Info.plist in Resources */,
Expand Down Expand Up @@ -1456,6 +1463,7 @@
34FCD366293DE62700E0DC8A /* DefaultEnrollUseCase.swift in Sources */,
A5AC96E829223F27003B7637 /* RealmQuestsStorage.swift in Sources */,
3472E8FB29421CB500BB304F /* DefaultFriendCalendarUseCase.swift in Sources */,
9BED4DF629470D8C00C60631 /* LaunchViewController.swift in Sources */,
A5003AB4293F5FEC00082A9C /* SignUpViewModel.swift in Sources */,
345687F829374D2500CA51E3 /* DayNamePickerView.swift in Sources */,
349955122923220E007AB99E /* SwiftUIPreview.swift in Sources */,
Expand Down
43 changes: 21 additions & 22 deletions DailyQuest/DailyQuest/Application/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,45 @@ import UIKit
import RxSwift

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?
var appCoordinator: AppCoordinator?
let appDIContainer = AppDIContainer()

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 windowScene = (scene as? UIWindowScene) else { return }
AppAppearance.setupAppearance()

let tabbarController = UITabBarController()

self.window = UIWindow(windowScene: windowScene)
self.window?.rootViewController = tabbarController
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene)
let viewController = LaunchViewController()
let navigation = UINavigationController(rootViewController: viewController)
self.window?.rootViewController = navigation
self.window?.makeKeyAndVisible()

self.appCoordinator = AppCoordinator(tabBarController: tabbarController,
appDIContainer: appDIContainer)
self.appCoordinator?.start()

return
}

func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}

func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}

func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}

func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}

func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
Expand All @@ -64,7 +56,14 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
let syncManager = SyncManager()
syncManager.sync()
}



func switchRoot() {
AppAppearance.setupAppearance()
let tabbarController = UITabBarController()
self.window?.rootViewController = tabbarController
self.appCoordinator = AppCoordinator(tabBarController: tabbarController,
appDIContainer: self.appDIContainer)
self.appCoordinator?.start()
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// LaunchViewController.swift
// DailyQuest
//
// Created by ์ด๋‹ค์—ฐ on 2022/12/12.
//

import UIKit
import Lottie

class LaunchViewController: UIViewController {

let animationView: LottieAnimationView = {
let animationView = LottieAnimationView(name: "max.lottie")
animationView.frame = CGRect(x:0,y:0,width: 300, height: 400)
animationView.contentMode = .scaleAspectFill
return animationView
}()

override func viewDidLoad() {
super.viewDidLoad()

view.backgroundColor = .white
view.addSubview(animationView)
animationView.center = view.center

animationView.play{ (finish) in
if let scene = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate {
scene.switchRoot()
}
}
}

deinit {
print("deinit")
}

}
1 change: 1 addition & 0 deletions DailyQuest/DailyQuest/Resource/max.lottie.json

Large diffs are not rendered by default.