Skip to content

Instantly share code, notes, and snippets.

import SwiftUI

struct ContentView: View {
    
    @State var breatheOut = false
    @State var breatheIn = true
    

RxSwift + ViewModelを使用したAPIサンプル(Kickstarter)

ViewController

import UIKit
import RxSwift
import RxCocoa

RxSwift + ViewModelを使用したAPIサンプル

ViewController

  
  import UIKit
import RxSwift
import RxCocoa

combineLatest

let password = PublishSubject<String>()
let repeatedPassword = PublishSubject<String>()

_ = Observable.combineLatest(password, repeatedPassword) { "\($0), \($1)" }
 .subscribe(onNext: { print("onNext: ", $0) })

Observalbe

let observable = Observable.of(
    "R",
    "Rx",
    "RxS",

UIButton

  • ボタンタップ
@IBOutlet weak private var button: UIButton!
private let disposeBag = DisposeBag()

button.rx.tap