일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- @Binding
- subject
- Creating Operators
- vim
- dismiss
- nonisolated
- typeorm
- SwiftUI
- Operators
- operator
- swift6
- init?
- NullObject
- @EnvironmentObject
- @State
- Xcode
- ios14
- init
- IOS
- URL(string:)
- RxSwift
- @Environment
- Operater
- nestjs
- graphql
- RFC1738/1808
- NavigationLink
- RxCocoa
- SWIFT
- Bug
- Today
- Total
목록RxCocoa (4)
Tunko Development Diary

RxCocoa 를 이용해 UICollectionView를 사용 let systemColors = [UIColor.systemRed, UIColor.systemOrange, UIColor.systemYellow, UIColor.systemGreen, UIColor.systemTeal, UIColor.systemBlue, UIColor.systemIndigo, UIColor.systemPurple, UIColor.systemPink, UIColor.systemBrown] @available(iOS 14.0, *) class TestViewController: UIViewController { @IBOutlet weak var collectionView: UICollectionView! let disposeB..

Driver Traits 에서 가장 핵심적인 Driver입니다. Driver는 share() 연산자를 사용한것 처럼 하나의 시퀀스에서 동작하는 옵저버블이며 Error를 방출하지 않습니다. Driver를 사용하기 위해선 기존 옵저버블에 asDriver() 연산자를 추가 기존 UI와 연동중이던 bind(to:) 를 .drive로 대체합니다. 예제) import UIKit import RxSwift import RxCocoa enum ValidationError: Error { case notANumber } class DriverViewController: UIViewController { let bag = DisposeBag() @IBOutlet weak var inputField: UITextField!..

바인딩 에는 소비자와 생산자가 있습니다. 생산자는 Observable 입니다. 소비자는 UI Component 입니다. Binder는 특별한 옵저버 입니다. 즉 데이터 소비자 입니다. Observable → Binder Binder는 옵저버이기에 새로운값을 전달할 수는 있지만 구독자를 추가할 수는 없습니다. Observable → Next ✅ → Binder Observable → Completed ✅ → Binder Observable → Error ❌ → Binder Binder는 Next 이벤트를 받으면 UI가 업데이트 됩니다. Binder는 Error 이벤트를 받지 않습니다. UI는 Main Thread에서 업데이트 되어야 합니다. 이제 UITextFiled 에 입력한 글씨는UILabel에 업데이..

RxCocoa는 cocoa touch 프레임워크에 reactive 의 장점을 더해준 라이브러리입니다. RxCocoa는 RxSwift를 기반으로 구동됩니다. cocoapods install을 통해서 RxSwift와 함께 설치해주어야 합니다. podfile pod 'RxSwift', '6.2.0' pod 'RxCocoa' 설치된 프로젝트에서 Pods/Pods/RxCocoa/UIButton+Rx.swift 파일을 열어보면 extension Reactive where Base: UIButton { public var tap: ControlEvent { controlEvent(.touchUpInside) } } 이런식으로 확장되어 있습니다. UIButton 을 직접적으로 확장하는것이 아니라 Base타입을 지정해서..