Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 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
63171d1
refactor: [#190] Scene을 Main, Game, Control로 객체 분리
torch-ray Sep 15, 2021
5e2dc79
chore: [#190] 메서드명 오타 수정
torch-ray Sep 15, 2021
7047a55
feat: [#190] SceneType 인터페이스 생성, 추후 coordinator의 파라미터로 사용하기 위함
torch-ray Sep 15, 2021
aace525
refactor: [#190] Setting, HowToPlay, Story Scene Control Scene으로 이동
torch-ray Sep 15, 2021
05660f9
refactor: [#190] SceneCoordinatorType default implemantation 메서드 코드 수…
torch-ray Sep 15, 2021
3cbab0c
chore: [#190] 불필요한 수정전 객체인 Scene 파일 삭제
torch-ray Sep 15, 2021
fc56232
chore: [#190] Scene 전환 정상동작 테스트 및 디렉토리 변경
torch-ray Sep 15, 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
15e6703
refactor: [#190] GameHelperScene으로 이름변경 후, GameCenter는 MainScene으로 이동
torch-ray Sep 16, 2021
264a8d4
refactor: [#191] Storage Key 값 상수 정의
eeeesong Sep 23, 2021
4999cf0
refactor: [#191] 가독성 개선을 위한 매개변수 명칭 변경
eeeesong Sep 23, 2021
fa29e5b
refactor: [#190] AlertScene 분리 및 프로토콜 띄어쓰기 변경
torch-ray Sep 24, 2021
ae4558c
Merge pull request #192 from SinsaStation/refactor/storage
torch-ray Sep 24, 2021
450b7a1
Merge branch 'iOS/dev' into refactor/scene
eeeesong Sep 24, 2021
e9e0e7f
Merge pull request #193 from SinsaStation/refactor/scene
eeeesong Sep 24, 2021
7000201
chore: [#189] test용 admob 키 적용
eeeesong Sep 24, 2021
c82795e
chore: [#194] Conflict 해결과정에서 발생한 오류 해결
torch-ray Sep 24, 2021
82ddbdf
chore: [#194] switch - case Lint Error 해결
torch-ray Sep 24, 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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,5 @@ FullStackCodingBot/Pods
!*.xcworkspace/contents.xcworkspacedata
**/xcshareddata/WorkspaceSettings.xcsettings

## Identifier
**/IdentifierManager.swift

# End of https://www.toptal.com/developers/gitignore/api/xcode,swift
138 changes: 95 additions & 43 deletions FullStackCodingBot/FullStackCodingBot.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

24 changes: 9 additions & 15 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,19 +54,17 @@ private extension AppDelegate {

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

_ settings: SettingInformation) -> SceneType {
switch hasLaunchedOnce {

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

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

}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import Foundation

enum IdentifierVC {
static let main = "MainVC"
static let shop = "ShopVC"
static let rank = "RankVC"
static let item = "ItemVC"
static let game = "GameVC"
static let pause = "PauseVC"
static let error = "ErrorVC"
static let gameOver = "GameOverVC"
static let setting = "SettingVC"
static let story = "StoryVC"
static let howTo = "HowToVC"
}

enum IdentiferAD {
static let reward = "ca-app-pub-3940256099942544/1712485313"
static let banner = "ca-app-pub-3940256099942544/2934735716"
}

enum IdentifierUD {
static let hasLaunchedOnce = "hasLaunchedOnce"
static let setting = "setting"
}

enum IdentifierGC {
static let leaderboard = "WeeklyScore"
static let leaderboard2 = "AllTimeScore"
}

This file was deleted.

Loading