Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Implementing Reactive Programming with ReSwift
Search
Eunju Amy Sohn
December 13, 2017
Programming
0
200
Implementing Reactive Programming with ReSwift
2017 Swift Korea Meetup 2 - ReSwift로 리액티브 프로그래밍 구현하기
Eunju Amy Sohn
December 13, 2017
Tweet
Share
More Decks by Eunju Amy Sohn
See All by Eunju Amy Sohn
내가 커뮤니티 스피킹을 하는 이유
ejsohn
1
400
Cloud Deep Learning for everyone
ejsohn
0
150
Microservice with go and gRPC
ejsohn
1
600
Spot Utilization for GPU Instance Cost Efficiency
ejsohn
0
98
40만명이 쓰는 Django channels 채팅서버, 우리는 어떻게 만들었나?
ejsohn
1
2.4k
Other Decks in Programming
See All in Programming
PipeCDのプラグイン化で目指すところ
warashi
1
290
AIと”コードの評価関数”を共有する / Share the "code evaluation function" with AI
euglena1215
1
180
LT 2025-06-30: プロダクトエンジニアの役割
yamamotok
0
810
フロントエンドのパフォーマンスチューニング
koukimiura
5
1.8k
Startups on Rails in Past, Present and Future–Irina Nazarova, RailsConf 2025
irinanazarova
0
200
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
280
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
5
1.4k
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
1
6.7k
レベル1の開発生産性向上に取り組む − 日々の作業の効率化・自動化を通じた改善活動
kesoji
0
270
おやつのお供はお決まりですか?@WWDC25 Recap -Japan-\(region).swift
shingangan
0
140
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
2
970
Quand Symfony, ApiPlatform, OpenAI et LangChain s'allient pour exploiter vos PDF : de la théorie à la production…
ahmedbhs123
0
210
Featured
See All Featured
A better future with KSS
kneath
238
17k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Practical Orchestrator
shlominoach
189
11k
Typedesign – Prime Four
hannesfritz
42
2.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
The Language of Interfaces
destraynor
158
25k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Writing Fast Ruby
sferik
628
62k
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.4k
Transcript
ReSwift 로 리액티브 프로그래밍 구현하 기 Swift Korea Meetup #2
Eunju Sohn
• 손은주 • 한양대학교 정보시스템학과 재학중 • 매스프레소 iOS 개발자
(콴다!) • Github @EJSohn
None
ReSwift는 단방향 데이터 흐름을 기본으 로 한 아키텍처 라이브러리 (Redux의
swift 구 현체) * https://github.com/ReSwift/ReSwift
그런데 왜..?
• https://en.wikipedia.org/wiki/Reactive_programming • https://karlbowden.com/reswift-prezzo/ • https://stackoverflow.com/questions/34497343/redux-rxjs-any-similarities
1. 2. 3. 4. ReSwift 동작 구조
*https://karlbowden.com/reswift-prezzo/ 현재 재생중인 노래 현재 재생중인 노래 같은 뷰 X
None
ReSwift Point App SubtractViewController AddViewController
State State Changes Views - 앱의 모든 상태는 Store에 저장되어
관리
State AppState.swift
Store AppDelegate.swift
State State Changes Views - 앱의 모든 상태는 Store에 저장되어
관리 - State는 Action에 의해서만 변경 가능 - 단방향 데이터 흐름
Action
Reducer AppReducer.swift
State State Changes Views - 앱의 모든 상태는 Store에 저장되어
관리 - State가 변화할 때 업데이트 - State는 Action에 의해서만 변경 가능 - 단방향 데이터 흐름
구독 UI AddViewController.swift
Action 디스패치 변화한 State 값을 비동기적으로 전달 AddViewController.swift 1. 2.
3.
SubtractViewController.swift Store에 subscribe한 객체들도 모두 동시에 알림을 받습니다! = state에
관련된 모든 UI 업데이트
None
언제 ReSwift를 사용하면 좋을까? • 여러 곳에서 같은 state를 사용,
변경하는 어플리케이션 • 부작용 핸들링을 해야할 때 • 단방향 데이터 흐름으로 부작용 최소화 • 웹소켓, 다양한 API를 사용할 때 * https://karlbowden.com/reswift-prezzo/
이럴 때는 추천드리지 않습니다 • State가 너무 많거나 큰 어플리케이션
• Ex) Image를 직접적으로 저장해두지 말아주세요 • 제스쳐 액션 퍼포먼스가 중요한 앱일 때 • RxSwift를 쓰세요! • Reducer를 심하게 괴롭힐 가능성이 있을 때 (끊이지 않는 action) • 속도 문제를 고려해야합니다. * https://karlbowden.com/reswift-prezzo/
PS. Redux는 Rx와도 잘 어울립니다! * https://redux.js.org/docs/introduction/PriorArt.html
References • https://github.com/ReSwift/ReSwift/issues/78 • https://stackoverflow.com/questions/34497343/redux-rxjs-any- similarities • https://redux.js.org/docs/introduction/PriorArt.html • https://github.com/ReSwift/ReSwift
• https://karlbowden.com/reswift-prezzo/ • https://medium.com/cocoaacademymag/architecture-thoughts- migrating-marvels-ios-app-to-reswift-ef7f20e84e60