일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
- UITextView
- Clean Code
- 리펙토링
- rxswift
- uiscrollview
- SWIFT
- uitableview
- swift documentation
- 클린 코드
- ribs
- Xcode
- MVVM
- Protocol
- HIG
- map
- RxCocoa
- swiftUI
- Observable
- 스위프트
- 리펙터링
- tableView
- clean architecture
- ios
- Refactoring
- 애니메이션
- UICollectionView
- Human interface guide
- combine
- collectionview
- 리팩토링
- Today
- Total
목록@ObservedObject (2)
김종권의 iOS 앱 개발 알아가기
목차) SwiftUI의 기본 - 목차 링크 * @Published, @objecervableObject 개념은 Combine이므로, Combine 관련 이전 포스팅 글 참고 @ObservedObejct 란? observable 객체를 구독하는 property wrapper observable 객체가 변경되면 뷰에 업데이트 시켜주는 기능 내부 코드 @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) @propertyWrapper @frozen public struct ObservedObject : DynamicProperty where ObjectType : ObservableObject { @dynamicMemberLookup @frozen pub..
@State View를 상속받는 뷰에서, 값을 변경할때 사용하는 프로퍼티 어노테이션 @State var n = 0 내부 구현부는 propertyWrapper를 사용한 형태 ex) @State를 붙이지 않은 경우 컴파일 에러 발생 struct ContentView: View { var n = 0 var body: some View { VStack { Text("\(n)") Button("Tap!!") { n += 1 // Error: Left side of mutating operator isn't mutable: 'self' is immutable } } } } ex) @State를 프로퍼티 앞에 붙일 경우 컴파일 에러 해결 struct ContentView: View { @State var n = 0 //