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

[GWL-284] 앱 코디네이터 Splash, Login 흐름 연결 #285

Merged
merged 3 commits into from
Dec 8, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Coordinator
import LoginFeature
import SplashFeature
import UIKit

Expand All @@ -25,7 +26,7 @@ final class AppCoordinator: AppCoordinating {
}

func start() {
showTabBarFlow()
showSplashFlow()
}

private func showSplashFlow() {
Expand All @@ -49,9 +50,15 @@ final class AppCoordinator: AppCoordinating {

func showLoginFlow() {
// TODO: LoginCoordinator 연결
let aCoordinator = ACoordinator(navigationController: navigationController)
childCoordinators.append(aCoordinator)
aCoordinator.start()

let loginCoordinator = LoginCoordinator(
navigationController: navigationController,
isMockEnvironment: true,
isMockFirst: true
)

childCoordinators.append(loginCoordinator)
loginCoordinator.start()
}

func showTabBarFlow() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
// MARK: - InitialUser

/// 처음 로그인 하는 유저의 Response를 담을 Entity
struct InitialUser {
public struct InitialUser {
/// 처음 로그인 하는지 아닌지
let isFirstLogined: Bool

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
// MARK: - Token

/// 백엔드로부터 받아온 JWT를 담을 데이터 entity
struct Token {
public struct Token {
/// accessToken
let accessToken: String?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

import Foundation

protocol LoginDidFinishedDelegate: AnyObject {
public protocol LoginDidFinishedDelegate: AnyObject {
func loginCoordinatorDidFinished(initialUser: InitialUser?, token: Token?)
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ import Log
import Trinet
import UIKit

final class LoginCoordinator: LoginCoordinating {
var navigationController: UINavigationController
var childCoordinators: [Coordinating] = []
weak var finishDelegate: CoordinatorFinishDelegate?
weak var loginFinishDelegate: LoginDidFinishedDelegate?
var flow: CoordinatorFlow = .login
public final class LoginCoordinator: LoginCoordinating {
public var navigationController: UINavigationController
public var childCoordinators: [Coordinating] = []
public weak var finishDelegate: CoordinatorFinishDelegate?
public weak var loginFinishDelegate: LoginDidFinishedDelegate?
public var flow: CoordinatorFlow = .login

private let isMockEnvironment: Bool
private let isMockFirst: Bool

init(
public init(
navigationController: UINavigationController,
isMockEnvironment: Bool,
isMockFirst: Bool
Expand All @@ -32,7 +32,7 @@ final class LoginCoordinator: LoginCoordinating {
self.isMockFirst = isMockFirst
}

func start() {
public func start() {
guard let jsonPath = isMockFirst ?
Bundle(for: Self.self).path(forResource: "Token", ofType: "json") : Bundle(for: Self.self).path(forResource: "InitialUser", ofType: "json"),
let jsonData = try? Data(contentsOf: .init(filePath: jsonPath))
Expand Down
2 changes: 1 addition & 1 deletion iOS/Projects/Features/SignUp/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let project = Project.makeModule(
targets: .feature(
.signUp,
testingOptions: [.unitTest],
dependencies: [.trinet, .keychain, .combineCocoa, .coordinator, .log, .designSystem, .feature(.login), .commonNetworkingKeyManager],
dependencies: [.trinet, .keychain, .combineCocoa, .coordinator, .log, .designSystem, .commonNetworkingKeyManager],
testDependencies: [],
resources: "Resources/**"
)
Expand Down
Loading