Created
November 2, 2019 10:12
-
-
Save IsaAliev/5ab82ae272248d51226892b02a9abef8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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