Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ViewModel: ObservableObject {
- @Published var firstSwitch: Bool = false
- @Published var secondSwitch: Bool = false
- var isValid: AnyPublisher<Bool,Never> {
- return $firstSwitch
- .combineLatest($secondSwitch)
- .map { $0.0 && $0.1 }
- .eraseToAnyPublisher()
- }
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement