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 all 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.
91 changes: 67 additions & 24 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 */; };
C7694E3F259C3E9F0053667F /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7694E3E259C3E9F0053667F /* MainViewController.swift */; };
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 @@ -39,8 +45,7 @@
C7694E37259C3E9F0053667F /* BankManagerUIApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BankManagerUIApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
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>"; };
C7694E3E259C3E9F0053667F /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; 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 /* MainViewController.swift */,
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 = (
C7694E3F259C3E9F0053667F /* ViewController.swift in Sources */,
CEC6B74B2B7218B800FC29C5 /* Banker.swift in Sources */,
C7694E3F259C3E9F0053667F /* MainViewController.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.

Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
//
// BankManagerUIApp - ViewController.swift
// Created by yagom.
// Copyright © yagom academy. All rights reserved.
//

import UIKit

final class MainViewController: UIViewController {
private let mainView: MainView
private let manager: BankManager
private var startTime: Date?
private var isTimerRepeats: Bool = false

init(manager: BankManager) {
self.mainView = MainView()
self.manager = manager
super.init(nibName: nil, bundle: nil)
manager.delegate = self
}

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()
manager.addCustomer()
manager.startBankingProcess(completion: stopTimer)
}

@objc func resetService() {
manager.reset()
stopTimer()
}

private func stopTimer() {
startTime = nil
isTimerRepeats = false
mainView.setTimer("업무시간 - 00:00:000")
}

private func countElapsedTime() {
if !isTimerRepeats {
startTime = Date()
isTimerRepeats = true
}
DispatchQueue.global().async {
while self.isTimerRepeats {
Thread.sleep(forTimeInterval: 0.005)
let now = Date()
guard let start = self.startTime else {
return
}
let elapsedTime = now.timeIntervalSince(start)
let minutes = Int(elapsedTime) / 60
let seconds = Int(elapsedTime) % 60
let milliseconds = Int(elapsedTime * 1000) % 1000

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

extension MainViewController {
func showCustomerView(_ customers: [Customer], isWaiting: Bool) {
mainView.appendCustomerView(customers, isWaiting: isWaiting)
}
}
Loading