Protocols

The following protocols are available globally.

  • Defines logical conditions used to constrain a search either for a fetch or for in-memory filtering.

    See more

    Declaration

    Swift

    public protocol Predicate
  • Type that can be converted to and from Apple’s Foundation equivalent types.

    See more

    Declaration

    Swift

    public protocol FoundationConvertible
  • Stores a primitive value. Useful for Swift wrappers for C primitives.

    See more

    Declaration

    Swift

    public protocol ByteValue
  • Encapsulates the metadata associated with the response to a a URL load request in a manner independent of protocol and URL scheme.

    Declaration

    Swift

    public protocol URLResponse
  • Defines the interface for supporting conversion between strings and other types of values.

    See more

    Declaration

    Swift

    public protocol Formatter
  • Regular expression interface.

    See more

    Declaration

    Swift

    public protocol RegularExpressionType: RawRepresentable, CustomStringConvertible
  • Bit mask that represents various options

    See more

    Declaration

    Swift

    public protocol BitMaskOption: RawRepresentable
  • Used for bridging one type to another.

    See more

    Declaration

    Swift

    public protocol Bridgeable
  • Used to convert values from one representation to another. Doesn’t fail.

    See more

    Declaration

    Swift

    public protocol Transformer
  • Transformer that allows reverse transformation.

    See more

    Declaration

    Swift

    public protocol ReverseTransformer: Transformer
  • Protocol for classes that can create equivalent duplicates of themselves.

    Duplicate is implied to be of the same mutablility as the reciever. The copy returned is immutable if the consideration “immutable vs. mutable” applies to the receiving object; otherwise the exact nature of the copy is determined by the class.

    Use Case: Classes that incapsuate information that need to be passed by reference (can’t be structs), but need copying for thread safety, immutablility etc.

    See more

    Declaration

    Swift

    public protocol Copying: class
  • Protocol for classes that have mutable and immutable types.

    Only classes that define an “immutable vs. mutable” distinction should adopt this protocol. Classes that don’t define such a distinction should adopt Copying instead.

    See more

    Declaration

    Swift

    public protocol MutableCopying: class, Copying
  • Describes a basis for ordering types.

    See more

    Declaration

    Swift

    public protocol SortDescriptor