Protocols

The following protocols are available globally.

  • The Constraint protocol is used to define the structure that must be implemented by concrete constraints.

    See more

    Declaration

    Swift

    public protocol Constraint : AsyncConstraint
  • The AsyncConstraint protocol is used to define the structure that must be implemented by concrete asynchronous constraints.

    See more

    Declaration

    Swift

    public protocol AsyncConstraint
  • The Predicate protocol defines the structure that must be implemented by concrete predicates.

    public struct CopyCatPredicate: Predicate {
    
        private let value: String
    
        public init(value: String) {
            self.value = value
        }
    
        public func evaluate(with input: String) -> Bool {
            return input == value
        }
    }
    
    let predicate = CopyCatPredicate(value: "alphabet")
    let isIdentical = predicate.evaluate(with: "alphabet")
    
    See more

    Declaration

    Swift

    public protocol Predicate : AsyncPredicate
  • The AsyncPredicate protocol defines the structure that must be implemented by concrete async predicates.

    See more

    Declaration

    Swift

    public protocol AsyncPredicate