筛选输出为2的倍数的字符
let textFile = UITextField.init(frame: CGRectMake(0, 100, 400, 50))
textFile.backgroundColor = UIColor.brownColor()
_ = textFile.rx_text
.map{ (temp : String) -> Int in
if let lastStr = temp.characters.last {
if let intTemp = Int(String(lastStr)) {
return intTemp
}
}
return -1
}
.filter{
$0 % 2 == 0
}
.subscribeNext{
print($0)
}
view.addSubview(textFile)