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

은행 창구 관리 앱 [Step4] 댄, 네로 #95

Open
wants to merge 53 commits into
base: d_Nero
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
56c2c88
config: Storyboard 삭제 및 초기 세팅
ODDNERO Feb 6, 2024
5b0ae02
config: 폴더 구조 변경
ODDNERO Feb 6, 2024
a21e079
config: BankManager 파일 업로드
ODDNERO Feb 6, 2024
3b44171
design: UIButton, StackView 추가
ODDNERO Feb 6, 2024
b8d525f
config: Model 파일 추가
ODDNERO Feb 6, 2024
43db72a
config: 콘솔 앱에 BankManager 파일 재추가
ODDNERO Feb 6, 2024
2ec7cb2
chore: 변수명 수정
ODDNERO Feb 6, 2024
ad8437f
feat: CustomLabel 생성
ODDNERO Feb 6, 2024
ae48f1b
refactor: UITableViewCell 로 변경(UILabel -> UITableViewCell)
ODDNERO Feb 6, 2024
f255323
design: MainView 관련 Constraints 설정
ODDNERO Feb 6, 2024
3cd19c1
refactor: UI 요구사항에 맞춰 BankManager 리팩토링
ODDNERO Feb 6, 2024
41d88e8
feat: addCustomerButtonTapped() 추가
ODDNERO Feb 6, 2024
dd79f7e
feat: cell identifier 를 위한 className 추가
eensungkim Feb 6, 2024
2e62808
chore: 함수명 변경(customerNumber -> getNodeValue)
eensungkim Feb 6, 2024
fd8a9c1
feat: CustomCell 활용하여 tableViewCell 데이터 업데이트 구현
eensungkim Feb 6, 2024
654cccd
feat: 예금/대출 고객 큐 병합하여 전달하는 기능 추가
eensungkim Feb 6, 2024
00187e2
feat: 고객 추가 버튼에 타겟 메서드 추가
eensungkim Feb 6, 2024
2bafe84
feat: 고객 번호가 초기화되지 않도록 기능 추가
eensungkim Feb 6, 2024
fa87371
refactor: OperationQueue에서 DispatchQueue 로 전환
eensungkim Feb 7, 2024
82472f2
fix: semaphore 를 공유하지 않는 이슈 해결(struct -> class 로 변경)
eensungkim Feb 7, 2024
3c336b3
fix: 고객 수가 10명씩 추가되도록 수정
eensungkim Feb 7, 2024
e1d1558
feat: 대기 고객 tableView 노출되도록 기능 추가
eensungkim Feb 7, 2024
f709997
design: label 중앙 정렬
eensungkim Feb 7, 2024
0461bbf
fix: 프로퍼티감시자 삭제(동작하지 않음)
eensungkim Feb 7, 2024
3502fd6
fix: 고객큐가 줄어들 때마다 UI에 반영되도록 수정
eensungkim Feb 7, 2024
f36b7a8
refactor: 불필요한 delegate 제거
eensungkim Feb 7, 2024
0cebdd0
chore: 변수명 변경
eensungkim Feb 7, 2024
2207cf9
refactor: StackView 활용으로 전환 (TableView -> StackView)
eensungkim Feb 7, 2024
53650f5
design: 스택뷰 전환을 위한 메인뷰 구조 변경
eensungkim Feb 7, 2024
3b37435
chore: 불필요한 delegate 삭제
eensungkim Feb 7, 2024
f306750
chore: 함수명 변경 및 위치 조정
eensungkim Feb 7, 2024
07b3909
feat: 업무중 고객 리스트 추가 및 삭제 메서드 구현
eensungkim Feb 7, 2024
ad29120
feat: 업무중 고객 데이터 추가 기능 구현
eensungkim Feb 7, 2024
06f64b3
chore: 위치 조정 및 프로퍼티감시자 추가
eensungkim Feb 7, 2024
fb61c29
feat: 고객 리스트 UI 그리는 기능 구현 (비동기에도 동작)
eensungkim Feb 8, 2024
725bde8
fix: 라벨텍스트색상 및 크기 수정
eensungkim Feb 8, 2024
676d82b
fix: 예금이 싱크로 돌던 문제 해결
eensungkim Feb 8, 2024
5c2e1d7
fix: 예금 업무 종료 후 대출 업무 진행중인 상황에서 예금 추가되어도 업무를 처리하지 않는 이슈 해결
eensungkim Feb 8, 2024
66d7af2
feat: 초기화 버튼 메서드와 연결
eensungkim Feb 8, 2024
b2802f7
feat: 타이머 기능 구현
eensungkim Feb 8, 2024
d47f25c
fix: 타이머 라벨 텍스트 "업무시간 - " 추가
eensungkim Feb 8, 2024
b01de31
fix: 타이머가 간혹 초기화되지 않는 이슈 수정
eensungkim Feb 8, 2024
cd0f3ec
chore: stopTimer 별도 함수로 분리 및 주석 삭제
eensungkim Feb 8, 2024
fdd4302
feat: 업무가 마무리된 경우 타이머 종료
eensungkim Feb 8, 2024
8f5aec0
chore: 네이밍 변경
eensungkim Feb 10, 2024
628697e
chore: 네이밍 변경
eensungkim Feb 10, 2024
49d27fa
refactor: 메인뷰 delegate 대신 뷰컨트롤러를 delegate
eensungkim Feb 11, 2024
d6227c1
fix: 초기화 버튼 클릭 이후 업무중으로 넘어가지 않는 이슈 해결
eensungkim Feb 12, 2024
799ad24
refactor: 세마포어를 큐가 아닌 비동기 태스크에서 관리하도록 변경
eensungkim Feb 12, 2024
ed23e6c
fix: 유저 인터랙션이 있는 경우 타이머가 초기화되지 않는 문제 해결
eensungkim Feb 12, 2024
9e6e9aa
refactor: MainViewController 메서드 접근제한자 추가
eensungkim Feb 12, 2024
ad16011
refactor: 뱅크매니저 weak 캡처로 변경
eensungkim Feb 12, 2024
b354a43
fix: 초기화 버튼 클릭 시 고객이 0번부터 생성되는 이슈 해결
eensungkim Feb 12, 2024
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 @@ -11,13 +11,13 @@
8A6A78F82B5FCE0E0027E5D3 /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A6A78F72B5FCE0E0027E5D3 /* Node.swift */; };
8A6A78FA2B5FCE7C0027E5D3 /* Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A6A78F92B5FCE7C0027E5D3 /* Queue.swift */; };
C7694E7A259C3EC00053667F /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7694E79259C3EC00053667F /* main.swift */; };
C7D65D1B259C8190005510E0 /* BankManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7D65D1A259C8190005510E0 /* BankManager.swift */; };
CE98E59E2B6396E600C36337 /* Banker.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE98E59D2B6396E600C36337 /* Banker.swift */; };
CE98E5A02B639AD800C36337 /* Customer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE98E59F2B639AD800C36337 /* Customer.swift */; };
CEB1F55C2B621FD0002F2047 /* BankManagerConsoleAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEB1F5562B621F3C002F2047 /* BankManagerConsoleAppTests.swift */; };
CEB1F55D2B621FDA002F2047 /* LinkedList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A6A78F52B5F562A0027E5D3 /* LinkedList.swift */; };
CEB1F55E2B621FDD002F2047 /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A6A78F72B5FCE0E0027E5D3 /* Node.swift */; };
CEB1F55F2B621FE0002F2047 /* Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A6A78F92B5FCE7C0027E5D3 /* Queue.swift */; };
CEC6B7552B721A7700FC29C5 /* BankManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC6B7542B721A7700FC29C5 /* BankManager.swift */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -38,11 +38,11 @@
8A6A78F92B5FCE7C0027E5D3 /* Queue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Queue.swift; sourceTree = "<group>"; };
C7694E76259C3EC00053667F /* BankManagerConsoleApp */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = BankManagerConsoleApp; sourceTree = BUILT_PRODUCTS_DIR; };
C7694E79259C3EC00053667F /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
C7D65D1A259C8190005510E0 /* BankManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BankManager.swift; path = ../../BankManager.swift; sourceTree = "<group>"; };
CE98E59D2B6396E600C36337 /* Banker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Banker.swift; sourceTree = "<group>"; };
CE98E59F2B639AD800C36337 /* Customer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Customer.swift; sourceTree = "<group>"; };
CEB1F5542B621F3C002F2047 /* BankManagerConsoleAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BankManagerConsoleAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
CEB1F5562B621F3C002F2047 /* BankManagerConsoleAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankManagerConsoleAppTests.swift; sourceTree = "<group>"; };
CEC6B7542B721A7700FC29C5 /* BankManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BankManager.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -84,7 +84,7 @@
C7694E78259C3EC00053667F /* BankManagerConsoleApp */ = {
isa = PBXGroup;
children = (
C7D65D1A259C8190005510E0 /* BankManager.swift */,
CEC6B7542B721A7700FC29C5 /* BankManager.swift */,
CE98E59D2B6396E600C36337 /* Banker.swift */,
CE98E59F2B639AD800C36337 /* Customer.swift */,
C7694E79259C3EC00053667F /* main.swift */,
Expand Down Expand Up @@ -194,9 +194,9 @@
8A6A78FA2B5FCE7C0027E5D3 /* Queue.swift in Sources */,
8A6A78F62B5F562A0027E5D3 /* LinkedList.swift in Sources */,
CE98E5A02B639AD800C36337 /* Customer.swift in Sources */,
CEC6B7552B721A7700FC29C5 /* BankManager.swift in Sources */,
CE98E59E2B6396E600C36337 /* Banker.swift in Sources */,
C7694E7A259C3EC00053667F /* main.swift in Sources */,
C7D65D1B259C8190005510E0 /* BankManager.swift in Sources */,
8A6A78F82B5FCE0E0027E5D3 /* Node.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
File renamed without changes.
85 changes: 64 additions & 21 deletions BankManagerUIApp/BankManagerUIApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,25 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
C7694E3B259C3E9F0053667F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7694E3A259C3E9F0053667F /* AppDelegate.swift */; };
C7694E3D259C3E9F0053667F /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7694E3C259C3E9F0053667F /* SceneDelegate.swift */; };
C7694E3F259C3E9F0053667F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7694E3E259C3E9F0053667F /* ViewController.swift */; };
C7694E42259C3E9F0053667F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C7694E40259C3E9F0053667F /* Main.storyboard */; };
C7694E44259C3EA20053667F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C7694E43259C3EA20053667F /* Assets.xcassets */; };
C7694E47259C3EA20053667F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C7694E45259C3EA20053667F /* LaunchScreen.storyboard */; };
C7694E52259C3EA20053667F /* BankManagerUIAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7694E51259C3EA20053667F /* BankManagerUIAppTests.swift */; };
C7694E5D259C3EA20053667F /* BankManagerUIAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7694E5C259C3EA20053667F /* BankManagerUIAppUITests.swift */; };
C7D65D1E259C81BD005510E0 /* BankManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7D65D1D259C81BD005510E0 /* BankManager.swift */; };
CEC6B7412B71FBCC00FC29C5 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC6B7402B71FBCC00FC29C5 /* MainView.swift */; };
CEC6B7432B72165600FC29C5 /* CustomerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC6B7422B72165600FC29C5 /* CustomerView.swift */; };
CEC6B74B2B7218B800FC29C5 /* Banker.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC6B74A2B7218B800FC29C5 /* Banker.swift */; };
CEC6B74D2B72191400FC29C5 /* Customer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC6B74C2B72191400FC29C5 /* Customer.swift */; };
CEC6B7512B72197400FC29C5 /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC6B74E2B72197400FC29C5 /* Node.swift */; };
CEC6B7522B72197400FC29C5 /* Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC6B74F2B72197400FC29C5 /* Queue.swift */; };
CEC6B7532B72197400FC29C5 /* LinkedList.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC6B7502B72197400FC29C5 /* LinkedList.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -40,7 +46,6 @@
C7694E3A259C3E9F0053667F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
C7694E3C259C3E9F0053667F /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
C7694E3E259C3E9F0053667F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
C7694E41259C3E9F0053667F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
C7694E43259C3EA20053667F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
C7694E46259C3EA20053667F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
C7694E48259C3EA20053667F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand All @@ -50,7 +55,14 @@
C7694E58259C3EA20053667F /* BankManagerUIAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BankManagerUIAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
C7694E5C259C3EA20053667F /* BankManagerUIAppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankManagerUIAppUITests.swift; sourceTree = "<group>"; };
C7694E5E259C3EA20053667F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C7D65D1D259C81BD005510E0 /* BankManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BankManager.swift; path = ../../BankManager.swift; sourceTree = "<group>"; };
C7D65D1D259C81BD005510E0 /* BankManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BankManager.swift; sourceTree = "<group>"; };
CEC6B7402B71FBCC00FC29C5 /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MainView.swift; path = BankManagerUIApp/View/MainView.swift; sourceTree = SOURCE_ROOT; };
CEC6B7422B72165600FC29C5 /* CustomerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomerView.swift; sourceTree = "<group>"; };
CEC6B74A2B7218B800FC29C5 /* Banker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Banker.swift; sourceTree = "<group>"; };
CEC6B74C2B72191400FC29C5 /* Customer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Customer.swift; sourceTree = "<group>"; };
CEC6B74E2B72197400FC29C5 /* Node.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Node.swift; sourceTree = "<group>"; };
CEC6B74F2B72197400FC29C5 /* Queue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Queue.swift; sourceTree = "<group>"; };
CEC6B7502B72197400FC29C5 /* LinkedList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LinkedList.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -101,13 +113,9 @@
C7694E39259C3E9F0053667F /* BankManagerUIApp */ = {
isa = PBXGroup;
children = (
C7D65D1D259C81BD005510E0 /* BankManager.swift */,
C7694E3A259C3E9F0053667F /* AppDelegate.swift */,
C7694E3C259C3E9F0053667F /* SceneDelegate.swift */,
C7694E3E259C3E9F0053667F /* ViewController.swift */,
C7694E40259C3E9F0053667F /* Main.storyboard */,
C7694E43259C3EA20053667F /* Assets.xcassets */,
C7694E45259C3EA20053667F /* LaunchScreen.storyboard */,
CEC6B73E2B71F95A00FC29C5 /* Model */,
CEC6B73D2B71F94200FC29C5 /* View */,
CEC6B73F2B71F97B00FC29C5 /* Controller */,
C7694E48259C3EA20053667F /* Info.plist */,
);
path = BankManagerUIApp;
Expand All @@ -131,6 +139,40 @@
path = BankManagerUIAppUITests;
sourceTree = "<group>";
};
CEC6B73D2B71F94200FC29C5 /* View */ = {
isa = PBXGroup;
children = (
CEC6B7402B71FBCC00FC29C5 /* MainView.swift */,
CEC6B7422B72165600FC29C5 /* CustomerView.swift */,
C7694E45259C3EA20053667F /* LaunchScreen.storyboard */,
C7694E43259C3EA20053667F /* Assets.xcassets */,
);
path = View;
sourceTree = "<group>";
};
CEC6B73E2B71F95A00FC29C5 /* Model */ = {
isa = PBXGroup;
children = (
C7D65D1D259C81BD005510E0 /* BankManager.swift */,
CEC6B74A2B7218B800FC29C5 /* Banker.swift */,
CEC6B74C2B72191400FC29C5 /* Customer.swift */,
CEC6B7502B72197400FC29C5 /* LinkedList.swift */,
CEC6B74E2B72197400FC29C5 /* Node.swift */,
CEC6B74F2B72197400FC29C5 /* Queue.swift */,
);
path = Model;
sourceTree = "<group>";
};
CEC6B73F2B71F97B00FC29C5 /* Controller */ = {
isa = PBXGroup;
children = (
C7694E3A259C3E9F0053667F /* AppDelegate.swift */,
C7694E3E259C3E9F0053667F /* ViewController.swift */,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

목적에 맞는 네이밍으로 수정부탁드립니다

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MainViewController 로 수정했습니다.

C7694E3C259C3E9F0053667F /* SceneDelegate.swift */,
);
path = Controller;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -193,8 +235,9 @@
C7694E2F259C3E9F0053667F /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1210;
LastUpgradeCheck = 1210;
LastUpgradeCheck = 1520;
TargetAttributes = {
C7694E36259C3E9F0053667F = {
CreatedOnToolsVersion = 12.1;
Expand Down Expand Up @@ -236,7 +279,6 @@
files = (
C7694E47259C3EA20053667F /* LaunchScreen.storyboard in Resources */,
C7694E44259C3EA20053667F /* Assets.xcassets in Resources */,
C7694E42259C3E9F0053667F /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -261,9 +303,16 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CEC6B74B2B7218B800FC29C5 /* Banker.swift in Sources */,
C7694E3F259C3E9F0053667F /* ViewController.swift in Sources */,
C7694E3B259C3E9F0053667F /* AppDelegate.swift in Sources */,
CEC6B7512B72197400FC29C5 /* Node.swift in Sources */,
CEC6B74D2B72191400FC29C5 /* Customer.swift in Sources */,
CEC6B7522B72197400FC29C5 /* Queue.swift in Sources */,
C7694E3D259C3E9F0053667F /* SceneDelegate.swift in Sources */,
CEC6B7432B72165600FC29C5 /* CustomerView.swift in Sources */,
CEC6B7412B71FBCC00FC29C5 /* MainView.swift in Sources */,
CEC6B7532B72197400FC29C5 /* LinkedList.swift in Sources */,
C7D65D1E259C81BD005510E0 /* BankManager.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -300,14 +349,6 @@
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
C7694E40259C3E9F0053667F /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
C7694E41259C3E9F0053667F /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
C7694E45259C3EA20053667F /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
Expand Down Expand Up @@ -356,6 +397,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -417,6 +459,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
32 changes: 0 additions & 32 deletions BankManagerUIApp/BankManagerUIApp/Base.lproj/Main.storyboard

This file was deleted.

18 changes: 18 additions & 0 deletions BankManagerUIApp/BankManagerUIApp/Controller/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// BankManagerUIApp - SceneDelegate.swift
// Created by yagom.
// Copyright © yagom academy. All rights reserved.
//

import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene)
window?.rootViewController = ViewController(dataSource: BankManager())
window?.makeKeyAndVisible()
}
}
59 changes: 59 additions & 0 deletions BankManagerUIApp/BankManagerUIApp/Controller/ViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//
// BankManagerUIApp - ViewController.swift
// Created by yagom.
// Copyright © yagom academy. All rights reserved.
//

import UIKit

class ViewController: UIViewController {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상속하지 않으니 final을 붙여도 되겠네요

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정했습니다!

private let mainView: MainView
private let dataSource: BankManager
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dataSource라는 네이밍은 어색한 것 같습니다. 차라리 manager가 나을 것 같아요.

Copy link
Author

@eensungkim eensungkim Feb 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

뷰에서 보여줘야 하는 데이터를 관장하고 있으니 dataSource 가 더 어울린다고 생각했었는데요.
말씀해주신 내용을 듣고 고민해보니 데이터만 다루는 것이 아니라, 실제로 내부적인 로직이 돌아가고 있고 여기에 따른 결과가 반영이 되고 있다는 점을 감안하면 manager 가 더 맞을 것 같습니다.
반영하여 수정했습니다!

private var stopwatch: Timer?
private var elapsedTime: TimeInterval = 0

init(dataSource: BankManager) {
self.mainView = MainView()
self.dataSource = dataSource
super.init(nibName: nil, bundle: nil)
dataSource.delegate = self.mainView
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

manager의 delegate 객체가 View가 되는 것은 View의 책임에 어울리지 않는 것 같은데, 어떻게 생각하시나요?
delegate로 처리하지 않고, ViewController가 mainView를 Configure 해주는 것이 각자 책임에 어울릴 것 같습니다.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

View 의 책임에 어울리지 않는다는 점에 동의합니다.
일단 동작하게 만들고 나서 리팩토링하자는 마음이었는데 시간이 모자라면서 챙기지 못했습니다. 😢

}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func viewDidLoad() {
super.viewDidLoad()
view = mainView
view.backgroundColor = .white
}

@objc func addCustomerButtonTapped() {
countElapsedTime()
dataSource.addCustomer()
dataSource.startBankingProcess()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 되면 초기화 없이 고객을 추가할 경우 stopwatch에 타이머가 계속 할당되지 않나요?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

타이머를 아예 새롭게 수정하여 문제를 해결했습니다.

}

@objc func resetService() {
dataSource.reset()
if let timer = stopwatch {
timer.invalidate()
stopwatch = nil
elapsedTime = 0
mainView.setTimer("업무시간 - 00:00:000")
}
}

func countElapsedTime() {
stopwatch = Timer.scheduledTimer(withTimeInterval: 0.005, repeats: true) { timer in
self.elapsedTime += timer.timeInterval
let minutes = Int(self.elapsedTime) / 60
let seconds = Int(self.elapsedTime) % 60
let milliseconds = Int(self.elapsedTime * 1000) % 1000

let timeString = String(format: "%02d:%02d:%03d", minutes, seconds, milliseconds)
self.mainView.setTimer("업무시간 - \(timeString)")
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

타이머는 어떻게 동작할까요?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timer 클래스는 일정한 시간이 지날 때마다 타겟이 되는 객체에 메시지를 전송합니다.
위 코드에서는 0.005초가 지날 때마다 기준이 되는 elapsedTime 에 지나간 시간을 초 기준으로 누적한 뒤, 이를 환산하여 뷰에 반영하고 있습니다.

말씀해주신 RunLoop 는 추가 공부가 필요한 것 같아 문서를 읽는 중입니다.
말씀해주신대로 인터랙션 발생시 의도한 대로 동작하지 않고 타이머 이벤트가 씹혀버리는 문제가 핵심이라고 판단하여,
타이머와 유사하게 동작하는 흐름을 별도의 비동기 스레드로 던져서 처리하는 방향으로 수정해 보았습니다.

}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 구조가 CustomView가 ViewController에 직접 접근하여 버튼 액션에 대한 기능을 사용하고 있는데, ViewController의 메서드들을 접근제한자 없이 공개적으로 사용하는 것 보단, View의 컴포넌트(버튼 등)을 오픈해놓은 것이 더 나을 것 같은데, 어떻게 생각하시나요?

Copy link
Author

@eensungkim eensungkim Feb 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드를 수정하면서 질문 주실때와 상황이 달라진건지 제가 조금 헷갈립니다만,
현재는 접근제한자를 붙여 MainViewController 안에서만 사용하도록 변경해두었습니다! 🙏

}
4 changes: 0 additions & 4 deletions BankManagerUIApp/BankManagerUIApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
Expand All @@ -43,8 +41,6 @@
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
Expand Down
Loading