Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. class ViewModel: ObservableObject {
  2.  
  3. @Published var firstSwitch: Bool = false
  4. @Published var secondSwitch: Bool = false
  5.  
  6. var isValid: AnyPublisher<Bool,Never> {
  7. return $firstSwitch
  8. .combineLatest($secondSwitch)
  9. .map { $0.0 && $0.1 }
  10. .eraseToAnyPublisher()
  11. }
  12. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement