You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.
Validation only checks if the value is nil or not. But for String type it should check for empty strings too. Since validation uses generics for input types, it is not able to check, because it does not know what type its input is.
For a temporary fix, you can use this in ValidationRuleRequired.swift file
public func validate(input: T?) -> Bool {
if let input = input as? String {
return input.count > 0
}
return input != nil
}
P.S.
Another temporary fix is setting textField's value to nil if it's value is an empty string, using UITextFieldDelegate. For example:
Why is this code valid?
How to use Wrong?
The text was updated successfully, but these errors were encountered: