Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
87733cd
refactor: [#191] Storage 객체 구조화 & Data Read 코드 개선
eeeesong Sep 14, 2021
2a2997a
refactor: [#191] 객체 이름 변경, 디렉토리 체계화
eeeesong Sep 14, 2021
bb411c9
refactor: [#191] 메소드 이름 변경
eeeesong Sep 15, 2021
927dc5b
refactor: [#191] 쓰지 않는 프로퍼티 삭제
eeeesong Sep 15, 2021
1b98ac1
refactor; [#191] DataFormatManager 디렉토리 이동
eeeesong Sep 15, 2021
06fea17
refactor: [#191] CoreData 관련 기능만 수행하는 객체 신설
eeeesong Sep 15, 2021
d8fe093
refactor: [#191] Game 데이터 관리 객체 신설
eeeesong Sep 15, 2021
5c5e9f3
refactor: [#191] PersistenceStorage 삭제에 따른 변경
eeeesong Sep 15, 2021
7a98e1c
refactor: [#191] Storage 객체 이니셜라이저 디폴트 값 추가
eeeesong Sep 15, 2021
e7e4f50
refactor: [#191] 저장 흐름 연결
eeeesong Sep 15, 2021
49093f5
refactor: [#191] 불필요한 메소드 제거, 실수로 지운 메소드 추가
eeeesong Sep 15, 2021
0c29d77
fix: [#191] 리워드 동기화 문제 해결
eeeesong Sep 15, 2021
1949c99
chore: [#191] 오타, 코멘트 수정
eeeesong Sep 15, 2021
20082ba
fix: [#191] 빠진 저장 구문 추가
eeeesong Sep 15, 2021
b4ba872
refactor: [#191] 프로퍼티 이름 변경, 호출 위치 변경
eeeesong Sep 15, 2021
264a8d4
refactor: [#191] Storage Key 값 상수 정의
eeeesong Sep 23, 2021
4999cf0
refactor: [#191] 가독성 개선을 위한 매개변수 명칭 변경
eeeesong Sep 23, 2021
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
112 changes: 70 additions & 42 deletions FullStackCodingBot/FullStackCodingBot.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

17 changes: 6 additions & 11 deletions FullStackCodingBot/FullStackCodingBot/AppCycle/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,20 @@ import AVFoundation
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
private let storage = PersistenceStorage()
private let adStorage = AdStorage()
private var storage: StorageType?
private let userDefaults = UserDefaults.standard

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
storage = Storage()
setAdMobs()
setAudioSession()
presentMainViewController()
return true
}

func applicationDidEnterBackground(_ application: UIApplication) {
let database = DatabaseManager(Database.database().reference())
let networkDTO = NetworkDTO(units: storage.itemList(), money: storage.myMoney(), score: storage.myHighScore(), ads: adStorage.currentInformation(), date: Date())
if storage.itemList().isEmpty { return }
database.updateDatabase(networkDTO)
storage?.save()
}
}

Expand All @@ -45,8 +42,7 @@ private extension AppDelegate {
let hasLaunchedOnce = userDefaults.bool(forKey: IdentifierUD.hasLaunchedOnce)
let settings = getSettingInformation(hasLaunchedOnce)
let coordinator = SceneCoordinator(window: window!)
let database = DatabaseManager(Database.database().reference())
let scene = getFirstScene(hasLaunchedOnce, coordinator, database, settings)
let scene = getFirstScene(hasLaunchedOnce, coordinator, settings)
coordinator.transition(to: scene, using: .root, with: StoryboardType.main, animated: false)
}

Expand All @@ -58,18 +54,17 @@ private extension AppDelegate {

private func getFirstScene(_ hasLaunchedOnce: Bool,
_ sceneCoordinator: SceneCoordinator,
_ database: DatabaseManager,
_ settings: SettingInformation) -> Scene {

switch hasLaunchedOnce {

case true:
let mainViewModel = MainViewModel(sceneCoordinator: sceneCoordinator, storage: storage, adStorage: adStorage, database: database, settings: settings)
let mainViewModel = MainViewModel(sceneCoordinator: sceneCoordinator, storage: storage!, settings: settings)
let mainScene = Scene.main(mainViewModel)
return mainScene

case false:
let storyViewModel = StoryViewModel(sceneCoordinator: sceneCoordinator, storage: storage, adStorage: adStorage, database: database, settings: settings)
let storyViewModel = StoryViewModel(sceneCoordinator: sceneCoordinator, storage: storage!, settings: settings)
let storyScene = Scene.story(storyViewModel)
return storyScene

Expand Down

This file was deleted.

This file was deleted.

Loading