계산기 II
목차
- 소개
- 팀원
- 타임라인
- 프로젝트 구조
- 실행화면(기능 설명)
- 트러블슈팅
- 참고링크
1. 소개
각자 작성한 계산기 앱 코드를 병합하여 리팩토링한 프로젝트
Common
Model
View
Controller
- [UIViewController] MainViewController
- 계산기 User Event 처리를 담당하는 객체
- 각 버튼 별 발생한 이벤트를 적절히 처리하는 기능
- view의 초기 화면을 설정하는 기능
2. 팀원
Rowan |
sehong |
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
|
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
|
Github Profile |
Github Profile |
3. 타임라인
프로젝트 진행 기간
- 23.02.06 (월) ~ 23.02.10 (금)
23.02.06 (월): 각자의 계산기 프로젝트 Merge, 리팩토링 및 STEP1 PR 작성
23.02.07 (화): STEP1 PR 피드백 반영, 계산기 작동 실험 후 리팩토링(1회 계산 이후 IBAction 조건 추가)
23.02.09 (목): 리팩토링 및 STEP2 PR 작성
23.02.10 (금): PR 피드백 반영, README 작성
4. 프로젝트 구조
UML
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
파일 구조
5. 실행 화면(기능 설명)
숫자, 기능 버튼 동작 |
0, 00, . 버튼 실행 화면 |
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
|
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
|
예외처리 |
스크롤 뷰 동작 |
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
|
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
|
- 숫자가 0인 경우 연산자 변경, 0으로 나눈경우 NaN 예외처리
- 스크롤뷰의 서브 뷰가 스크롤뷰 영역을 넘어가는 경우 항상 최하단으로 스크롤 이동
6. 트러블 슈팅
Merge Conflict
프로젝트 초기 Merge 과정에서 PR을 통한 코드 병합 중, 계속 Conflict가 발생했습니다.
서로의 프로젝트 파일 구조, 이름이 다르기 때문에 발생한 문제였다고 생각하여 conflict가 발생하지 않도록 팀원의 레포지토리를 로컬에 클론하여 Merge를 진행하였습니다.
또한 Terminal과 Xcode를 이용하여 직접 Conflict를 처리하기에 어려움을 느꼈습니다. 조금 더 수월한 Conflict 처리를 위해 Git 관리 Tool인 Git Fork를 사용하였습니다.
저희는 리팩토링을 하면서 휴대폰에 계산기 기본 어플과 비슷하게 구현하려고 했습니다.
계산기 앱에서는 계산 결과를 받은 뒤에 숫자만 입력하면 새로운 계산이 시작되고, 계산 결과를 받은 뒤에 연산자 기호를 입력하면 결과 값을 가지고 계산이 시작되는 부분을 확인했습니다.
기존에는 결과 값을 받은 뒤에 숫자만 입력하면 숫자가 결과에 붙는 방식이었는데 이를 휴대폰 계산기앱 방식 그대로 수정하여 기능을 추가하게 되었습니다.
Typealias
기존에 선언되어있는 타입에 새로운 별칭을 붙여 반복되어 사용되는 코드의 길이를 줄이고 가독성을 높이려고 사용했습니다.
7. 참고 링크