일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- SWIFT
- Clean Code
- combine
- Human interface guide
- rxswift
- map
- Protocol
- RxCocoa
- Refactoring
- Xcode
- 스위프트
- swiftUI
- clean architecture
- ios
- tableView
- Observable
- uitableview
- MVVM
- uiscrollview
- ribs
- HIG
- collectionview
- 애니메이션
- 리펙터링
- 리펙토링
- 클린 코드
- swift documentation
- 리팩토링
- UICollectionView
- UITextView
- Today
- Total
목록button (3)
김종권의 iOS 앱 개발 알아가기
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/ebUUxv/btrIsQHufn5/LTK0wEWD5eBql7XAN4BV0K/img.png)
목차) SwiftUI의 기본 - 목차 링크 Button 개념 Button안에 텍스트를 적고 closure에 액션을 기입 Button("MyButton") { print("did tap") } action을 앞에서 받고 뒤에 Text와 같은 컴포넌트를 넣어서 표출도 가능 색상은 systemBlue가 디폴트로 설정 Button(action: { print("tap button!") }) { Text("MyButton") } action에 클로저로 넣어도 되지만, 일반 func 함수를 넣어도 가능 struct ContentView: View { var body: some View { Button(action: self.didTapButton) { //
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/dz3Aho/btreaQc1TFu/gTYGLKMfHeDgzmGk0HLt5K/img.gif)
keyboard 바로 위에 버튼 표출 구현 방법 TextField, TextView안에 내장된 inputAccessoryView 프로퍼티에 UIView 대입 UIView.addSubview로 Button 추가 textField나 TextView의 receiver가 becomeFirstResponse가 된 경우, 키보드가 표출할떄 키보드 위의 영역 nil이 디폴트값이고 따로 View를 추가하여 대입 필요 inputAccessoryView에 대입할 View 정의 lazy var accessoryView: UIView = { return UIView(frame: CGRect(x: 0.0, y: 0.0, width: UIScreen.main.bounds.width, height: 72.0)) }() textFi..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cihn4I/btq9sCYTtBG/FuOf3CkBMyNw6NwczcndJk/img.png)
BaseButton 정의 configure()에는 커스텀 버튼에 기본적으로 실행될 레이아웃 구성 bind()에는 커스텀 버튼에 특정 데이터에 대한 UI 구성 class BaseButton: UIButton { override init(frame: CGRect) { super.init(frame: frame) configure() } @available(*, unavailable) required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } func configure() {} func bind() {} } RoundedShadowButton 구현 configure() 구현 button이 가지고 있는 프로퍼티인 i..