Skip to content

Instantly share code, notes, and snippets.

View SwiftUI Sample.md
import SwiftUI

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

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

ViewController

import UIKit
import RxSwift
import RxCocoa
View WikipediaSearchViewModel.md

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

ViewController

  
  import UIKit
import RxSwift
import RxCocoa
View Rx Operator.md

combineLatest

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

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

Observalbe

let observable = Observable.of(
    "R",
    "Rx",
    "RxS",
View UIKit RxSwift.md

UIButton

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

button.rx.tap