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
See moreparallaxScrollViewDidScroll(_:)
on all adopters, and forconfigureParallaxScrollInset(_:)
forUIViewController
s.Declaration
Swift
public protocol ParallaxScrollable: UIScrollViewDelegate
-
Definition of an object for adding KVO and
NSNotificationCenter
obeservations to pure Swift classes.NSObject
s implement a method calledmethodSignatureForSelector:
which converts from strings to methods. Pure Swift classes do not have this method so cannot inherently perform KVO or observeNSNotificationCenter
posts. Rather than making a Swift class inherit fromNSObject
, which introuduces unnecessary features, anObserver
can be retained which performs an arbitrary block on copmletion.Two default implementations are provided,
See moreNotificationObserver
andObjectObserver
forNSNotificationCenter
observing and keypath observing respectively.Declaration
Swift
public protocol Observer
-
Protocol to be adopted by a class that gives easy loading of
UIViewController
s from multipleUIStoryboard
s.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 allUIViewControllers
declared 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 morerawValue
s 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