Protocols
The following protocols are available globally.
-
Minimum information required to display cell in table view
See moreDeclaration
Swift
public protocol TableViewCellInformation
-
Minimum information required to display cell in table view
See moreDeclaration
Swift
public protocol TableViewConfigurableCellInformation
-
Allows to get class name string
See moreDeclaration
Swift
public protocol ClassName
-
Usually views might conform to this protocol so it’s possible to pass view model without typecasting.
See moreDeclaration
Swift
public protocol Configurable
-
Helps to print all object fields and values
See moreDeclaration
Swift
public protocol Describable : CustomStringConvertible
-
Helps to instantiate object from xib file.
See moreDeclaration
Swift
public protocol InstantiatableFromXib
-
Helps to instantiate object from storyboard file.
See moreDeclaration
Swift
public protocol InstantiatableFromStoryboard : AnyObject
-
Helps to instantiate content view from storyboard file.
See moreDeclaration
Swift
public protocol InstantiatableContentView
-
Simplifies Managers start and reset routine. All managers could be then started/reseted on apropriate point in app, e.g. on user login/logout.
To get all Managers in some place (e.g. ApplicationManager) you could use following construction:
See moreprivate var managers: [Manager.Type] = { return g_getClassesConformToProtocol(Manager.self) }()
Declaration
Swift
public protocol Manager : AnyObject, ClassName
-
Undocumented
See moreDeclaration
Swift
public protocol Occupiable
-
Undocumented
See moreDeclaration
Swift
public protocol InitializeableOccupiable : Occupiable
-
Undocumented
See moreDeclaration
Swift
public protocol OptionalType
-
Protocol that simplifies custom page size configuration for UIScrollView. Sadly, can not be done better due to protocol extensions limitations - https://stackoverflow.com/questions/39487168/non-objc-method-does-not-satisfy-optional-requirement-of-objc-protocol
Note
Set.decelerationRate
toUIScrollViewDecelerationRateFast
for a fancy scrolling animation.Declaration
Swift
public protocol ScrollViewCustomHorizontalPageSize : UIScrollViewDelegate
-
Simplifies work with classes that need some routine to be performed once on app load.
It’s behaviour is close to
[NSObject load]
but since overriding[NSObject load]
method can’t be used in Swift you may use this protocol instead.Using property assures code will never be executed twice.
See morestatic var setupOnce: Int = { // This code will be called once on app start return 0 }()
Declaration
Swift
@objc public protocol SetupOnce