Skip to content

Commit

Permalink
[Feat/#104] 코디네이터 적용으로 ContentView AppView로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoe0929 committed Nov 15, 2024
1 parent b686d5c commit 59641e3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 102 deletions.
31 changes: 31 additions & 0 deletions HMH_Tuist_iOS/Projects/App/Sources/AppView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// AppView.swift
// HMH-iOS
//
// Created by 이지희 on 11/15/24.
// Copyright © 2024 HMH-iOS. All rights reserved.
//

import SwiftUI

import KakaoSDKAuth

import DSKit
import Core

struct AppView: View {
@StateObject var coordinator = AppCoordinator(navigationPath: .init())

var body: some View {
ZStack {
Color(DSKitAsset.blackground.swiftUIColor)
.ignoresSafeArea(.all)
coordinator.start()
}
.onOpenURL { url in
if AuthApi.isKakaoTalkLoginUrl(url) {
_ = AuthController.handleOpenUrl(url: url)
}
}
}
}
91 changes: 0 additions & 91 deletions HMH_Tuist_iOS/Projects/App/Sources/Common/Custom/ContentView.swift

This file was deleted.

12 changes: 1 addition & 11 deletions HMH_Tuist_iOS/Projects/App/Sources/HMH_iOSApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import KakaoSDKAuth
struct HMH_iOSApp: App {
let kakaoAPIKey = Bundle.main.infoDictionary?["KAKAO_API_KEY"] as! String
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
@StateObject private var scheduler = MidnightTaskScheduler()
@Environment(\.scenePhase) private var scenePhase

init() {
Expand All @@ -23,16 +22,7 @@ struct HMH_iOSApp: App {

var body: some Scene {
WindowGroup {
ContentView()
}
.onChange(of: scenePhase) { newPhase in
switch newPhase {
case .background:
print("App moved to background.")
scheduler.scheduleMidnightTask()
@unknown default:
break
}
AppView()
}
}
}

0 comments on commit 59641e3

Please sign in to comment.