URLPredicate
public class URLPredicate : Predicate
The URLPredicate
class is used to evaluate whether a given input is a syntactically valid URL.
-
Declaration
Swift
public typealias InputType = String
-
Creates and returns a new
URLPredicate
instance.Declaration
Swift
public init()
-
Returns a
Boolean
value that indicates whether a given input is a valid URL.Declaration
Swift
public func evaluate(with input: InputType) -> Bool
Parameters
input
The input against which to evaluate the receiver.
Return Value
true
if input is a valid URL, otherwisefalse
.