Skip to content

Instantly share code, notes, and snippets.

@IsaAliev
Created November 2, 2019 10:12
Show Gist options
  • Save IsaAliev/5ab82ae272248d51226892b02a9abef8 to your computer and use it in GitHub Desktop.
Save IsaAliev/5ab82ae272248d51226892b02a9abef8 to your computer and use it in GitHub Desktop.
import Foundation
import Bond
class ViewModel {
let name = Observable<String?>(nil)
let greeting = Observable<String?>(nil)
lazy var sayHelloCommand: ActionCommand = {
return ActionCommand { [unowned self] in
self.sayHello()
}
}()
private func sayHello() {
greeting.value = "Hello, \(name.value ?? "")"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment