Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Intro to Rx-Swift
Search
Hamdullah shah
July 18, 2016
Technology
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Intro to Rx-Swift
Introduction to Rx-Swift at MYCocoaHeads July meet-up
Hamdullah shah
July 18, 2016
Other Decks in Technology
See All in Technology
AIがコードを書く時代に、エンジニアは何で自分の価値を証明するのか / In an era where AI writes code how do engineers prove their value
carta_engineering
3
1.1k
Benchmarking Disaggregated Serving on vLLM + Dynamo with a Real Coding-Agent Workload
nttcom
1
190
hackers_champloo_2026_tidb
makocchi
0
160
その Valkey 使いこなしていますか?
onk
PRO
5
1.5k
Claude Code本は、どのように執筆チームで書かれたか
oikon48
1
380
QA4AI 2026-Oct 生成AI時代の品質保証
tokuty
1
860
AI時代のPRレビューにどう向き合うか?
kairim0
1
240
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
8
3.1k
SAENM ~Jupyterで残すPoCの試行錯誤、未来の自分と仲間を助ける記録!~
terapyon
0
110
分析AIエージェントを育てる、動く環境を育てる
codatum
1
1.1k
DWH の限界突破! AI エージェント向け爆速リアルタイムデータ基盤 ClickHouse
jozono
1
470
Rustuna: Rustによる高速なOptuna実装
pfn
PRO
0
190
Featured
See All Featured
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
Navigating Weather and Climate Data
rabernat
0
560
Raft: Consensus for Rubyists
vanstee
142
7.8k
Balancing Empowerment & Direction
lara
6
1.3k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Site-Speed That Sticks
csswizardry
13
1.6k
The untapped power of vector embeddings
frankvandijk
2
1.9k
Odyssey Design
rkendrick25
PRO
2
870
A Tale of Four Properties
chriscoyier
163
24k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
630
Transcript
Rx-Swift Hamdullah shah
[email protected]
What’s RxSwift ? Reactive Extension http://reactivex.io
Reactive Programming Observable Pattern + Iterator Pattern + Functional Programming
best practices
var generator = [1,2,3,4,5].generate() while let elem = generator.next() {
print(elem) } Iterator: NSNotificationCenter.defaultCenter().addObserver( self, selector: #selector(batteryLevelChanged), name: UIDeviceBatteryLevelDidChangeNotification, object: nil) Observer:
Functional Programming [1, 2, 3, 4, 5, 6] .filter {
$0 % 2 == 0 } .map { $0 * 5 } .reduce(0, combine: +)
Instead of Array Values, Can we do this with Events
?
I/O Async Events
Array<T> Observable<T>
public enum Event<Element> { /// Next element is produced. case
Next(Element) /// Sequence terminated with an error. case Error(ErrorType) /// Sequence completed successfully. case Completed } X
Subscribing for Data [1, 2, 3, 4, 5, 6] .toObservable()
.subscribeNext { print($0) } “1” “2” “3” “4” “5” “6”
[1,2,3,4,5,6] .toObservable() .subscribe(onNext: { (intValue) in //pumped out int },
onError: { (error) in //ERROR! }, onCompleted: { //There are no more signals }) { //we disposed this subscription }) Subscribing for Data, Error and Completion
Create from Existing Object [1, 2, 3, 4, 5, 6]
.toObservable() textField.rx_text .asObservable() NSURLSession.sharedSession() .rx_JSON(request) *RxCocoa
Memory Management let disposeBag = DisposeBag() let gestureRecognizer = UIGestureRecognizer()
gestureRecognizer.rx_event .subscribeNext { [weak self]_ in self?.processDetectedTap() } .addDisposableTo(disposeBag) view.addGestureRecognizer(gestureRecognizer)
Creating Observables • asObservable • create • deferred • empty
• error • toObservable (array) • interval • never • just • of • range • repeatElement • timer Filtering Observables • debounce / throttle • distinctUntilChanged • elementAt • filter • sample • skip • take • takeLast • single Transforming Observables • buffer • flatMap • flatMapFirst • flatMapLatest • map • scan • window Combining Observables • merge • startWith • switchLatest • combineLatest • zip Error Handling Operators • catch • retry • retryWhen Observable Utility Operators • delaySubscription • do / doOnNext • observeOn / observeSingleOn • subscribe • subscribeOn • timeout • using • debug Conditional and Boolean Operators • amb • skipWhile • skipUntil • takeUntil • takeWhile Mathematical and Aggregate Operators • concat • reduce / aggregate • toArray Connectable Observable Operators • multicast • publish • refCount • replay • shareReplay Operators http://rxmarbles.com
• Subject • BehaviorSubject • PublishSubject • ReplaySubject More Definitions
• Subject • BehaviorSubject • PublishSubject • ReplaySubject More Definitions
“Variable”
Now Threads
None
Demo
Thanks :) Questions ????
Thanks :) Questions ????