일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 스위프트
- ribs
- uiscrollview
- 애니메이션
- swiftUI
- Refactoring
- RxCocoa
- Protocol
- uitableview
- UICollectionView
- Human interface guide
- ios
- MVVM
- 리펙토링
- tableView
- 리팩토링
- Xcode
- Clean Code
- rxswift
- swift documentation
- map
- collectionview
- HIG
- Observable
- combine
- 클린 코드
- SWIFT
- 리펙터링
- UITextView
- clean architecture
- Today
- Total
목록dynamic (2)
김종권의 iOS 앱 개발 알아가기
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cg4dpw/btraVoXE9p6/kCYyqnA4NkGPpNZqKK5IFK/img.gif)
MyDynamicView의 내부 컨텐츠(text)가 변할때 마다 컨텐츠를 감싸고 있는 view도 동시에 조정 class ViewController: UIViewController { lazy var myView: MyDynamicView = { let view = MyDynamicView() view.text = "123" return view }() override func viewDidLoad() { super.viewDidLoad() view.addSubview(myView) myView.center = view.center DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) { self.myView.text = "1" self.myView.center ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/ciJJkY/btqXXU9VWqA/F4Gy0XYzhlLgdK9Zv19k80/img.gif)
상황 내부 크기가 동적으로 증가하는 경우 (label.text와 같은 경우), superView의 width를 동적으로 증가하여 내부 레이아웃을 유지할 수 있는 방법 값에 따라 크기가 동적으로 늘어나는 - 예시) UILabel let temporaryLabel = UILabel() temporaryLabel.font = UIFont.systemFont(ofSize: 12) temporaryLabel.text = "sampleDataString" print(temporaryLabel.intrinsicContentSize) // (101.0, 14.5) temporaryLabel.text = "sampleDataLongString ---- long ----" print(temporaryLabel.intrin..