RxSwift without [weak self]

HUA YU TSENG
Nov 22, 2021

--

Some scenarios like login feature, We have accountTextField, passwordTextField, and login button on the screen, while user tap login button We will call API with input account and password for login request parameter like this (Which is not reactive enough and need [weak self] 😈).

We can use combineLatest(resultSelector: ) and modify to this (We prevent using [weak self] cause capture self is no need 👼 )

Don’t forget using .throttle for the tap action.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

HUA YU TSENG
HUA YU TSENG

Written by HUA YU TSENG

I am Red, an iOS developer, I have hands on experience in iOS, Flutter, familiar with RxSwift Moya Unit/UI testing and Gitlab-CI.

No responses yet

Write a response