일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Operater
- vim
- Operators
- @Environment
- dismiss
- NullObject
- nonisolated
- typeorm
- init
- RFC1738/1808
- @EnvironmentObject
- SWIFT
- RxSwift
- URL(string:)
- Creating Operators
- @State
- RxCocoa
- NavigationLink
- IOS
- SwiftUI
- swift6
- Bug
- Xcode
- ios14
- operator
- graphql
- nestjs
- subject
- init?
- @Binding
- Today
- Total
목록Tunko room (147)
Tunko Development Diary
debounce let disposeBag = DisposeBag() let tapObservable = Observable.create { observer in DispatchQueue.global().async { for i in 1...10 { observer.onNext("Tap \\(i)") Thread.sleep(forTimeInterval: 0.3) } Thread.sleep(forTimeInterval: 1) for i in 11...20 { observer.onNext("Tap \\(i)") Thread.sleep(forTimeInterval: 0.5) } observer.onCompleted() } return Disposables.create { } } tapObservable .de..
take let disposeBag = DisposeBag() let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] Observable.from(numbers) .take(5) .subscribe { print($0) } .disposed(by: disposeBag) 출력 next(1) next(2) next(3) next(4) next(5) completed take 인자로 들어간 count만큼 방출합니다. take(while:) let disposeBag = DisposeBag() let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] Observable.from(numbers) .take(while: { $0 < 3} ) .subscribe {..
ignoreElements let disposeBag = DisposeBag() let elements = [0,1,2,3,4,5] Observable.from(elements) .ignoreElements() .subscribe { print($0) } .disposed(by: disposeBag) 옵저버블이 방출하는 Next 이벤트는 무시 error와 completed 이벤트만 받습니다. element(at:) let disposeBag = DisposeBag() let elements = [0,1,2,3,4,5] Observable.from(elements) .element(at: 3) .subscribe { print($0) } .disposed(by: disposeBag) 특정인덱스에 위치한 속..
repeatElement let disposeBag = DisposeBag() let element = "👍" Observable.repeatElement(element) .take(10) .subscribe { print($0) } .disposed(by: disposeBag) 출력 next(👍) next(👍) next(👍) next(👍) next(👍) next(👍) next(👍) next(👍) next(👍) next(👍) completed 동일한 요소를 반복적으로 방출하는 연산자입니다. 무한정 반복합니다. 따라서 방출되는 횟수를 정해주는게 중요합니다. take 연산자를 사용해서 10개의 요소만 방출되도록 해주었습니다. deferred let disposeBag = DisposeBag() var fla..
옵저버블을 생성하는 연산자 입니다. Just let disposeBag = DisposeBag() let element = "👍" Observable.just(element) .subscribe { event in print(event)} .disposed(by: disposeBag) Observable.just(["👍", "👊", "👎"]) .subscribe { event in print(event)} .disposed(by: disposeBag) 출력 next(👍) completed next(["👍", "👊", "👎"]) completed Just 연산자는 옵저버블을 생성하면서 요소를 방출합니다. 배열로 된 요소도 한번에 방출하게 됩니다. Of let disposeBag = DisposeBag() ..