-
Notifications
You must be signed in to change notification settings - Fork 0
[전얀] 계산기 만들기 #15
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
base: main
Are you sure you want to change the base?
[전얀] 계산기 만들기 #15
Conversation
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.
수고하셨습니다👍🏻 옵셔널 잘 사용해주셨네요!
isa = XCSwiftPackageProductDependency; | ||
package = 2D6D0B0B2B0BCBF2007F19CA /* XCRemoteSwiftPackageReference "SnapKit" */; | ||
productName = "SnapKit-Dynamic"; | ||
}; | ||
/* End XCSwiftPackageProductDependency section */ |
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.
혹시 시뮬레이터 실행 잘 되셨나요?
스냅킷 추가하실 때는 SnapKit-Dynamic 말고 그냥 SnapKit 하나만 추가해주세요!
make.leading.equalTo(view.safeAreaLayoutGuide.snp.leading).offset(36) | ||
make.trailing.equalTo(view.safeAreaLayoutGuide.snp.trailing).offset(-36) |
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.
make.leading.trailing.equalTo(view.safeAreaLayoutGuide.snp.leading).inset(36)
한 줄로 가능합니다!
} | ||
number1TextField.snp.makeConstraints { make in | ||
make.top.equalToSuperview().offset(111) | ||
make.centerX.equalToSuperview() |
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.
inset을 적용했다면 centerX를 해주지 않아도 됩니다
- leading, trailing inset 적용
- centerX 적용, width 지정
두 방법이 있습니다
textField.layer.borderWidth = 1 | ||
textField.layer.borderColor = UIColor.black.cgColor | ||
textField.backgroundColor = .white | ||
textField.placeholder = "숫자 1 입력" | ||
|
||
let paddingView = UIView(frame: CGRect(x: 0, y: 0, width: 10, height: textField.frame.height)) | ||
textField.leftView = paddingView | ||
textField.leftViewMode = .always |
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.
textField.borderStyle = .roundedRect 사용하시면 둥근 모서리와 왼쪽 패딩 모두 해결할 수 있습니다
💡 Description
계산기 만들기 완료했습니다.
📝 Progress