일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- RxCocoa
- swiftUI
- Refactoring
- 리펙터링
- Xcode
- rxswift
- 스위프트
- swift documentation
- UITextView
- 리팩토링
- 클린 코드
- Clean Code
- uitableview
- ribs
- UICollectionView
- MVVM
- map
- clean architecture
- SWIFT
- HIG
- tableView
- Human interface guide
- ios
- uiscrollview
- 애니메이션
- 리펙토링
- collectionview
- combine
- Protocol
- Observable
- Today
- Total
목록커스텀 버튼 (4)
김종권의 iOS 앱 개발 알아가기
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/Trsq2/btsJ3L5nQXi/b0xXWw1QYYGHkHV2bQv591/img.gif)
뷰를 버튼처럼 만드는 방법일반 SwiftUI의 버튼은 Button(action:label:)형태이며, presssed color는 label부분이 투명해지는 효과가 디폴트로 들어간 상태(코드)struct ContentView: View { @State private var isPressed = false @State private var isChecked = false var body: some View { VStack { normalButton } } @ViewBuilder private var normalButton: some View { Button(action: { isChe..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bprQzI/btrIADHoAuH/7IrY0xSDEK076L7g0T1JYK/img.png)
목차) SwiftUI의 기본 - 목차 링크 * Button 기본 개념은 이전 포스팅 글 참고 커스텀 버튼 구현 아이디어 ButtonStyle을 준수하는 struct형을 만들고, makeBody(configuration:) 메소드를 구현 SwiftUI에서는 상속사용을 지양하기 때문에, 사용하는 쪽에서 .buttonStyle()으로 사용 // 커스텀 ScaleButton을 만들기 위해서 ButtonStyle 준수하고 makeBody 메서드 구현 struct ScaleButton: ButtonStyle { func makeBody(configuration: Configuration) -> some View { } } makeBody 인자 configuration은 label 프로퍼티에 접근할수 있는데, 이 l..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cjqKee/btrDtgDUEtI/CJhhyP59YFXKK3JJp2z8XK/img.png)
Roundable 버튼 layer.cornerRadius값이 width나 height의 값의 반일때 원이 되므로 이 특성을 사용 // ViewController.swift NSLayoutConstraint.activate([ self.circleView.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 120), self.circleView.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), self.circleView.widthAnchor.constraint(equalToConstant: 120), self.circleView.heightAnchor.constraint(equalToCons..
목표 baseButton을 하나 만들고, 공통적으로 baseButton의 속성을 가지면서 각자의 특색있는 커스텀 버튼 생성 BaseButton 생성 cornerRadius가 4인 Base버튼 클래스 생성 // // MyBaseButton.swift // Test // // Created by 김종권 on 2020/11/20. // import Foundation import UIKit class MyBaseButton: UIButton { override init(frame: CGRect) { super.init(frame: frame) setupView() } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) setupView(..