Failed to set (fieldImage) user defined inspected property on (UITextField)

Could you help me with this error ? I try to add icon to UITextFeild and it show error like this :

Failed to set (fieldImage) user defined inspected property on (UITextField)

Here is my code :

var errorImg =  UIImageView(frame: CGRect(x: 0, y: 0, width: 30,height: 30))
errorImg.image = UIImage(named: "error")
errorImg.contentMode = UIViewContentMode.right
txtEmail.rightViewMode = .always
txtEmail.rightView = errorImg

txtPhone.rightViewMode = .always
txtPhone.rightView = errorImg

Please help . Thank you.