Protocols

The following protocols are available globally.

  • Protocol extending UIScrollViewDelegate to adjust the scrolling of a given view to mimic a parallax motion between the two views.

    Default implementations are given for parallaxScrollViewDidScroll(_:) on all adopters, and for configureParallaxScrollInset(_:) for UIViewControllers.

    See more

    Declaration

    Swift

    public protocol ParallaxScrollable: UIScrollViewDelegate
  • Definition of an object for adding KVO and NSNotificationCenter obeservations to pure Swift classes.

    NSObjects implement a method called methodSignatureForSelector: which converts from strings to methods. Pure Swift classes do not have this method so cannot inherently perform KVO or observe NSNotificationCenter posts. Rather than making a Swift class inherit from NSObject, which introuduces unnecessary features, an Observer can be retained which performs an arbitrary block on copmletion.

    Two default implementations are provided, NotificationObserver and ObjectObserver for NSNotificationCenter observing and keypath observing respectively.

    See more

    Declaration

    Swift

    public protocol Observer
  • Protocol to be adopted by a class that gives easy loading of UIViewControllers from multiple UIStoryboards.

    Two enum types are specified that should be used to identify each UIViewController and the Storyboard from which it can be loaded. The app specific adopter should then implement:

    • storyboardIdentifierForViewControllerIdentifier(_:)

    typically using a switch statement, to ensure exhaustive coverage of all UIViewControllers declared at compile time. There is a defualt implementation for

    • instantiateViewControllerForIdentifier(_:bundle:).

    that should not need to be overriden.

    There are defualt implementations for

    • storyboardNameForIdentifier(_:)
    • viewControllerNameForIdentifier(_:)

    where the enum types are backed by strings. These return the enum rawValues in those implementations.

    See more

    Declaration

    Swift

    public protocol StoryboardLoader
  • Protocol defining the requirements of an object to provide a ‘User Friendly’ string, such as ‘Your device is not connected to the internet.’ not 'NSURLError -1001’.

    Extensions are given for:

    See more

    Declaration

    Swift

    public protocol UserFacing