Reputation: 899
secondTextField.rac_textSignal()
.map { (value: AnyObject!) -> Int in
let textFromField = value as! NSString
return textFromField.length
**line }.filter { (filter: AnyObject!) -> Bool in
let textLength = filter as! Int
return textLength > 3
}
line marked **line gives Swift compiler error ... Cannot invoke 'filter' with an argument list of type '((AnyObject!) -> Bool)'
... what gives??
Upvotes: 0
Views: 249
Reputation: 3196
Because this line isn't actual failed line of code. Try to change return type of closure in the map
call to return AnyObject. Xcode isn't very accurate when dealing with Swift yet.
.map { (value: AnyObject!) -> AnyObject in
Upvotes: 3