Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.97 KB | None | 0 0
  1. let fieldsUpdatess = fields
  2.             .compactMap { $0 as? TextFieldViewModel }
  3.             .map { field in
  4.  
  5.                 field.didFinishEditingSubject
  6.                    
  7.  
  8.                 Driver.combineLatest(field.text, field.isValid)
  9.                     .filter { $1 }
  10.                     .do(onNext: {
  11.                         address.value.update(field.fieldType, with: $0.0)
  12.                         if let copyTo = field.copyTo {
  13.                             address.value.update(copyTo, with: $0.0)
  14.                         }
  15.                     }).mapToVoid()
  16.  
  17. //                field
  18. //                    .text
  19. //                    .do(onNext: {
  20. //                        address.value.update(field.fieldType, with: $0)
  21. //                        if let copyTo = field.copyTo {
  22. //                            address.value.update(copyTo, with: $0)
  23. //                        }
  24. //                    })
  25. //                    .alwaysMap(to: ())
  26.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement