From 78a14f61aa805cc15108542db83d44a8dc92d086 Mon Sep 17 00:00:00 2001 From: kimjinu Date: Wed, 15 Dec 2021 01:18:49 +0900 Subject: [PATCH] =?UTF-8?q?[Remove]=20=EC=95=88=20=EC=93=B0=EB=8A=94=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=82=AD=EC=A0=9C=20#25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BMDJ.xcodeproj/project.pbxproj | 28 ---------- BMDJ/Deprecated/DanjiProvider.swift | 85 ----------------------------- BMDJ/Extension/UIImage.swift | 11 ---- BMDJ/ViewModel/DanjiViewModel.swift | 64 ---------------------- BMDJ/ViewModel/MemoViewModel.swift | 14 ----- 5 files changed, 202 deletions(-) delete mode 100644 BMDJ/Deprecated/DanjiProvider.swift delete mode 100644 BMDJ/Extension/UIImage.swift delete mode 100644 BMDJ/ViewModel/DanjiViewModel.swift delete mode 100644 BMDJ/ViewModel/MemoViewModel.swift diff --git a/BMDJ.xcodeproj/project.pbxproj b/BMDJ.xcodeproj/project.pbxproj index c7d4ed9..64a6997 100644 --- a/BMDJ.xcodeproj/project.pbxproj +++ b/BMDJ.xcodeproj/project.pbxproj @@ -24,7 +24,6 @@ 65261A7C269359B5005E877C /* MemoRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65261A7B269359B5005E877C /* MemoRepository.swift */; }; 65261A7E2693616A005E877C /* MemoCreate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65261A7D2693616A005E877C /* MemoCreate.swift */; }; 6528EA1B2635219400D06F17 /* BMDJImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6528EA1A2635219400D06F17 /* BMDJImage.swift */; }; - 653C1157273E3DA400DAA916 /* DanjiProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 658A1DCF2655657700622D95 /* DanjiProvider.swift */; }; 65429F8B2660CDA2000819BE /* NetworkResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65429F8A2660CDA2000819BE /* NetworkResult.swift */; }; 65440B5826B6757500186E7B /* PrivacyPolicyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65440B5726B6757500186E7B /* PrivacyPolicyViewController.swift */; }; 65440B5A26B67C1100186E7B /* PrivacyPolicyReactor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65440B5926B67C1100186E7B /* PrivacyPolicyReactor.swift */; }; @@ -79,7 +78,6 @@ 659625F8262BFA2B00277B80 /* Memo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 659625F7262BFA2B00277B80 /* Memo.swift */; }; 659E542B265510AC00C6378A /* BMDJTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 659E542A265510AC00C6378A /* BMDJTextField.swift */; }; 659EF7F32677A4D9003006F4 /* DanjiDregs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 659EF7F22677A4D9003006F4 /* DanjiDregs.swift */; }; - 65AC5D11269DE41E008FFFB7 /* UIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65AC5D10269DE41E008FFFB7 /* UIImage.swift */; }; 65B02E7B2651109A00A61D17 /* DanjiSettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65B02E7A2651109A00A61D17 /* DanjiSettingViewController.swift */; }; 65B02E7E2651177200A61D17 /* DanjiSettingViewReactor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65B02E7D2651177200A61D17 /* DanjiSettingViewReactor.swift */; }; 65B02E8126511B3200A61D17 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65B02E8026511B3200A61D17 /* LoginViewController.swift */; }; @@ -177,7 +175,6 @@ 6587E2F8264E4C5D00654178 /* DanjiRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DanjiRouter.swift; sourceTree = ""; }; 6587E2FB264E59FF00654178 /* DanjiClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DanjiClient.swift; sourceTree = ""; }; 65898D7626CC180400DAD62C /* IndicatorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IndicatorViewController.swift; sourceTree = ""; }; - 658A1DCF2655657700622D95 /* DanjiProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DanjiProvider.swift; sourceTree = ""; }; 658CC9F1263D38E9000286D3 /* MemoCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoCollectionCell.swift; sourceTree = ""; }; 658CC9F4263D440F000286D3 /* DanjiCollectionCellReactor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DanjiCollectionCellReactor.swift; sourceTree = ""; }; 658CC9FB263DB89B000286D3 /* MemoCollectionCellReactor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoCollectionCellReactor.swift; sourceTree = ""; }; @@ -187,13 +184,10 @@ 659625F7262BFA2B00277B80 /* Memo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Memo.swift; sourceTree = ""; }; 659E542A265510AC00C6378A /* BMDJTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BMDJTextField.swift; sourceTree = ""; }; 659EF7F22677A4D9003006F4 /* DanjiDregs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DanjiDregs.swift; sourceTree = ""; }; - 65AC5D10269DE41E008FFFB7 /* UIImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIImage.swift; sourceTree = ""; }; 65B02E7A2651109A00A61D17 /* DanjiSettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DanjiSettingViewController.swift; sourceTree = ""; }; 65B02E7D2651177200A61D17 /* DanjiSettingViewReactor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DanjiSettingViewReactor.swift; sourceTree = ""; }; 65B02E8026511B3200A61D17 /* LoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; 65B02E8326511E9D00A61D17 /* DanjiLoginViewReactor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DanjiLoginViewReactor.swift; sourceTree = ""; }; - 65B0EAF8265686F000B10021 /* DanjiViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DanjiViewModel.swift; sourceTree = ""; }; - 65B0EAFC2656882000B10021 /* MemoViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoViewModel.swift; sourceTree = ""; }; 65B377A2262AE513000D03E7 /* BMDJ.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BMDJ.app; sourceTree = BUILT_PRODUCTS_DIR; }; 65B377A5262AE513000D03E7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 65B377AE262AE514000D03E7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -294,14 +288,6 @@ path = Setting; sourceTree = ""; }; - 65261A7A269359A1005E877C /* Deprecated */ = { - isa = PBXGroup; - children = ( - 658A1DCF2655657700622D95 /* DanjiProvider.swift */, - ); - path = Deprecated; - sourceTree = ""; - }; 653837912632F10B00F4D6EC /* Frameworks */ = { isa = PBXGroup; children = ( @@ -506,15 +492,6 @@ path = Network; sourceTree = ""; }; - 65B0EAF7265686D800B10021 /* ViewModel */ = { - isa = PBXGroup; - children = ( - 65B0EAF8265686F000B10021 /* DanjiViewModel.swift */, - 65B0EAFC2656882000B10021 /* MemoViewModel.swift */, - ); - path = ViewModel; - sourceTree = ""; - }; 65B37799262AE513000D03E7 = { isa = PBXGroup; children = ( @@ -539,8 +516,6 @@ 65FD602026B05FDB0049023F /* BMDJ.entitlements */, 65B377BA262AE598000D03E7 /* Resource */, 65B377C2262AE5BD000D03E7 /* Extension */, - 65261A7A269359A1005E877C /* Deprecated */, - 65B0EAF7265686D800B10021 /* ViewModel */, 65739EA1263E9633009AA160 /* Utility */, 6577641426371777001947CF /* Service */, 659625FA262BFA3E00277B80 /* Network */, @@ -580,7 +555,6 @@ 651BAC22265A31090090D6A7 /* UIView.swift */, 65457B92265AD3C800F7F8F3 /* URLRequest.swift */, 65D7D29126849BDF00D69C7C /* Array.swift */, - 65AC5D10269DE41E008FFFB7 /* UIImage.swift */, 65110673269F44B0009AB050 /* Int.swift */, ); path = Extension; @@ -818,7 +792,6 @@ 6577641626371780001947CF /* AppService.swift in Sources */, 65139D2826B31AE000E32718 /* AuthClient.swift in Sources */, 65620A06266E84E30041C780 /* MemoViewController.swift in Sources */, - 653C1157273E3DA400DAA916 /* DanjiProvider.swift in Sources */, 65B02E7B2651109A00A61D17 /* DanjiSettingViewController.swift in Sources */, 6560409A2680F4FF00F9A725 /* SettingTItleHeader.swift in Sources */, 6575A016267E64990004ACEF /* File+Utility.swift in Sources */, @@ -836,7 +809,6 @@ 65FF1E122658F44E00F65164 /* ColorCollectionCell.swift in Sources */, 65DB9A6B26E3DC8500643D71 /* LicenseListViewReactor.swift in Sources */, 6585A97E265D69CD008D6858 /* MemoRouter.swift in Sources */, - 65AC5D11269DE41E008FFFB7 /* UIImage.swift in Sources */, 65DB9A6D26E3DCC700643D71 /* LicenseDetailViewReactor.swift in Sources */, 6587E2F9264E4C5D00654178 /* DanjiRouter.swift in Sources */, 65B02E8426511E9D00A61D17 /* DanjiLoginViewReactor.swift in Sources */, diff --git a/BMDJ/Deprecated/DanjiProvider.swift b/BMDJ/Deprecated/DanjiProvider.swift deleted file mode 100644 index b965e69..0000000 --- a/BMDJ/Deprecated/DanjiProvider.swift +++ /dev/null @@ -1,85 +0,0 @@ -// -// DanjiProvider.swift -// BMDJ -// -// Created by 김진우 on 2021/05/20. -// - -import Foundation - -import RxSwift -import RxRelay - -final class DanjiProvider { - - private typealias DanjiRecord = (danji: Danji, count: Int, updatedAt: Date) - - // MARK: - Private Property - private let queue = DispatchQueue(label: "DanjiProvider", qos: .utility) - private let danjiRelay = BehaviorRelay<[String: DanjiRecord]>(value: [:]) - private let danjiObservable: Observable<[String: DanjiRecord]> - let observable: Observable<[Danji]> - - // MARK: - Init - init() { - danjiObservable = danjiRelay - .asObservable() - .subscribe(on: SerialDispatchQueueScheduler(queue: queue, internalSerialQueueName: UUID().uuidString)) - - observable = danjiObservable - .map { $0.map { $0.value.danji } } - } - - func add(_ danji: Danji) { - queue.sync { - var danjiRecords = self.danjiRelay.value - if let record = danjiRecords[danji.id] { - danjiRecords[danji.id] = DanjiRecord(danji: danji, count: record.count + 1, updatedAt: Date()) - } else { - danjiRecords[danji.id] = DanjiRecord(danji: danji, count: 1, updatedAt: Date()) - } - self.danjiRelay.accept(danjiRecords) - } - } - - func update(_ danji: Danji) { - queue.sync { - var danjiRecords = self.danjiRelay.value - if let record = danjiRecords[danji.id] { - danjiRecords[danji.id] = DanjiRecord(danji: danji, count: record.count + 1, updatedAt: Date()) - } - self.danjiRelay.accept(danjiRecords) - } - } - - func retain(id: String) { - queue.sync { - var danjiRecords = self.danjiRelay.value - if var record = danjiRecords[id] { - record.count += 1 - danjiRecords[id] = record - self.danjiRelay.accept(danjiRecords) - } - } - } - - func release(id: String) { - queue.sync { - var danjiRecords = self.danjiRelay.value - if var record = danjiRecords[id] { - record.count -= 1 - if record.count < 1 { - danjiRecords.removeValue(forKey: id) - danjiRelay.accept(danjiRecords) - } - } - } - } - - func danji(_ danji: Danji) -> Observable { - return danjiObservable - .map { $0[danji.id] } - .map { $0!.danji } - .share(replay: 1, scope: .whileConnected) - } -} diff --git a/BMDJ/Extension/UIImage.swift b/BMDJ/Extension/UIImage.swift deleted file mode 100644 index 7c1bfdf..0000000 --- a/BMDJ/Extension/UIImage.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// UIImage.swift -// BMDJ -// -// Created by 김진우 on 2021/07/14. -// - -import UIKit - -//extension UIImage: Codable { -//} diff --git a/BMDJ/ViewModel/DanjiViewModel.swift b/BMDJ/ViewModel/DanjiViewModel.swift deleted file mode 100644 index 24afc73..0000000 --- a/BMDJ/ViewModel/DanjiViewModel.swift +++ /dev/null @@ -1,64 +0,0 @@ -// -// DanjiViewModel.swift -// BMDJ -// -// Created by 김진우 on 2021/05/20. -// - -import Foundation - -import RxSwift -import RxCocoa - -final class DanjiViewModel { - - let id: String - let createDate: Date - - let userID: Observable - let color: Observable - let name: Observable - let stock: Observable - let volume: Observable - let mood: Observable - let endDate: Observable - let dDay: Observable - - let disposeBag = DisposeBag() - - init(danji: Danji) { - id = danji.id - createDate = danji.createDate - - DanjiProvider.shared.add(danji) - - let danjiObserver = DanjiProvider.shared.danji(danji) - .asObservable() - .share(replay: 1, scope: .whileConnected) - - userID = danjiObserver - .map { $0.userID } - - color = danjiObserver - .map { $0.color } - - name = danjiObserver - .map { $0.name } - - stock = danjiObserver - .map { $0.stock } - - volume = danjiObserver - .map { $0.volume } - - mood = danjiObserver - .map { $0.mood } - - endDate = danjiObserver - .map { $0.endDate } - - dDay = danjiObserver - .map { $0.dDay } - } -} - diff --git a/BMDJ/ViewModel/MemoViewModel.swift b/BMDJ/ViewModel/MemoViewModel.swift deleted file mode 100644 index 5f2802d..0000000 --- a/BMDJ/ViewModel/MemoViewModel.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// MemoViewModel.swift -// BMDJ -// -// Created by 김진우 on 2021/05/20. -// - -import Foundation - -import RxSwift - -final class MemoViewModel { - -}