URLPredicate

public class URLPredicate : Predicate

The URLPredicate class is used to evaluate whether a given input is a syntactically valid URL.

  • 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: String) -> Bool

    Parameters

    input

    The input against which to evaluate the receiver.

    Return Value

    true if input is a valid URL, otherwise false.