-
primaryViewReuseIDDefault implementationThe reuse id of the primary view.
This is like the reuseIdentifier of
UITableViewCell.Every
Tweakabletype must have a primary view. The primary view is used for tweaking the value. For example,Booluses a switcher as its primary view.If this method is not implemented, then the return value is assumed to be the id of blank placeholder primary view.
For more information about primary view please checkout
TweakPrimaryView.Default Implementation
Declaration
Swift
static var primaryViewReuseID: String { get } -
primaryViewDefault implementationThe primary view.
Every
Tweakabletype must have a primary view. The primary view is used for tweaking the value. For example,Booluses a switcher as its primary view.If this method is not implemented, then the return value is assumed to be a blank placeholder primary view.
For more information about primary view please checkout
TweakPrimaryView.Default Implementation
Declaration
Swift
static var primaryView: TweakPrimaryView { get } -
hasSecondaryViewDefault implementationA flag indicates whether the
Tweakabletype has a secondary view.A
Tweakabletype can opt-in a secondary view when its primary view has not enough room to display the UI for users to change the value. For example,UIColoruses a secondary view which uses some sliders for adjustment.If this method is not implemented, then the return value is assumed to be false.
Note
The value ofhasSecondaryViewshould be the same assecondaryView != nil. The reason why we use a separated property is to avoid unnecessary initialization of a secondary. Sometimes we just need to know whether the type has a secondary view.For more information about secondary view please checkout
TweakSecondaryView.Default Implementation
Declaration
Swift
static var hasSecondaryView: Bool { get } -
secondaryViewDefault implementationThe secondary view.
A
Tweakabletype can opt-in a secondary view when its primary view has not enough room to display the UI for users to change the value. For example,UIColoruses a secondary view which uses some sliders for adjustment.If this method is not implemented, then the return value is assumed to be nil.
For more information about secondary view please checkout
TweakSecondaryView.Default Implementation
Declaration
Swift
static var secondaryView: TweakSecondaryView? { get } -
validateAsDefaultValue()Default implementationValidates the receiver can be the default value of the tweak.
Not every value is a valid default value for a tweak. For example, It’s meaningless to tweak a empty array.
If this method is not implemented, then the return value is assumed to be true.
Default Implementation
Declaration
Swift
func validateAsDefaultValue() -> BoolReturn Value
True if the receiver can be the default value of the tweak; otherwise, false.
View on GitHub
Tweakable Protocol Reference