-
Notifications
You must be signed in to change notification settings - Fork 178
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
계산기(모둠) [STEP 1] Nicholas, Ari #134
계산기(모둠) [STEP 1] Nicholas, Ari #134
Conversation
- 초기값 0일경우 0, 00 입력 받지 못하게 함 - 초기값이 0일경우 입력된 숫자로 대치
- 사용자의 입력을 changeNumberFormatter 함수를 거쳐 label에 표현 - operand label 값 이외에 별도의 inputedOperand 변수에 입력됨
- 초기 상태에서 연산자 입력시에 무시하도록 개선
- formula 변수 선언 - insertFormual 함수 선언 - resetFormula 함수 선언 - calculate 함수 선언
- CustomStringConvertible 채택 - description 프로퍼티 선언
- CalculatorViewController 의 연산자 버튼의 타이틀과 동일하도록
- 현재 입력된 값이 0일 경우 guard문으로 대체
- 삭제 이유: NumberFormatter에서 해당 조건을 확인함
- CalculatorItemQueue 수정에 따른 테스트코드 전반적 수정 - 코드 수정에 따른 Formula, ExpressionParser, CalculatorController 전반적 수정
- CustomView인 FormulaStackView 클래스 추가 - addFormula 메소드를 삭제 후 addCurrentFormulaStack 메소드를 추가 - 커스텀뷰를 추가하면서 CalculatorController.insertFormula 메소드도 동작하게 구현 - DispatchQueue로 지연을 주었던 autoScrollDown 메소드 삭제 후 scrollToBottom 메소드 추가
- 계산이 완료되었을 때 hasCalculated를 true로 대입 - 계산이 완료되었을 때 숫자버튼,닷버튼,PlusMinus버튼이 작동하지 않도록 수정 - 계산이 완료되고 clearEntry버튼을 터치 시 모든 계산식이 초기화되게 수정
- 결과값이 Nama일 경우 operator 입력 불가
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다!
커멘트 해드린 부분 다음 스텝하면서 바로 수정하시면 될 것 같아요!
다음 브랜치는 Nicholas_Ari_step_0 이런식으로 하면 좋을 것 같아요!
네 개선사항은 step2에서 진행해주세요!
import Foundation | ||
import UIKit | ||
|
||
class calculatorHistoryUILbel: UILabel { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
클래스명은 대문자로 시작하는 부분, Label 오타 확인해주세요!
클래스명에서는 끝에 UI까지 안붙이고 Label이라고 하면 충분히 UILabel이라고 유추할 수 있을 것 같아요!
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기서 fatalError를 호출하지 않고 super.init 으로 처리해주세요.
|
||
private func addCurrentFormulaStack() { | ||
guard let `operator` = operatorLabel.text, | ||
let operand = operandLabel.text else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기 공백이 두개 들어간 것 같아요 확인해주세요!
@corykim0829
@Kim-EunsooSilver @leeari95
안녕하세요. 코리~ 이번 프로젝트 피드백 잘부탁드립니다. 😊
이번에 단순히 서로 코드를 비교하며 합치는 작업만 해서 특별히 궁금한 점은 없었습니다.
간단히 코드를 합치면서 고민했던 부분을 적어보았는데 혹시 부족한 점이 있다면 피드백 부탁드립니다! 😁
고민했던 것
궁금했던 것 / 조언이 필요한 부분