Protocols
The following protocols are available globally.
-
Protocol extending
UIScrollViewDelegateto adjust the scrolling of a given view to mimic a parallax motion between the two views.Default implementations are given for
See moreparallaxScrollViewDidScroll(_:)on all adopters, and forconfigureParallaxScrollInset(_:)forUIViewControllers.Declaration
Swift
public protocol ParallaxScrollable: UIScrollViewDelegate
-
Definition of an object for adding KVO and
NSNotificationCenterobeservations to pure Swift classes.NSObjects implement a method calledmethodSignatureForSelector:which converts from strings to methods. Pure Swift classes do not have this method so cannot inherently perform KVO or observeNSNotificationCenterposts. Rather than making a Swift class inherit fromNSObject, which introuduces unnecessary features, anObservercan be retained which performs an arbitrary block on copmletion.Two default implementations are provided,
See moreNotificationObserverandObjectObserverforNSNotificationCenterobserving and keypath observing respectively.Declaration
Swift
public protocol Observer
-
Protocol to be adopted by a class that gives easy loading of
UIViewControllers from multipleUIStoryboards.Two enum types are specified that should be used to identify each
UIViewControllerand the Storyboard from which it can be loaded. The app specific adopter should then implement:storyboardIdentifierForViewControllerIdentifier(_:)
typically using a
switchstatement, to ensure exhaustive coverage of allUIViewControllersdeclared at compile time. There is a defualt implementation forinstantiateViewControllerForIdentifier(_: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
See morerawValues in those implementations.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 moreDeclaration
Swift
public protocol UserFacing
View on GitHub
Protocols Reference