FeatureConstraintsBuilder
public protocol FeatureConstraintsBuilder : AnyObject
The protocol for the builder used to evaluate the constraints convention function
of conditional features.
-
Called to desclare a new platform requirement
Declaration
Swift
func platform(_ requirement: PlatformConstraint) -
Called to required checks to
isEnabledevery time availability checking is performedDeclaration
Swift
func runtimeEnabled() -
purchase(_:)Default implementationCalled add a purchase requirement to a feaature
- param requirement: The purchase requirement you wish to apply to the feature
Default Implementation
Call to declare a product that your feature requires
Call to declare a product that your feature requires
Declaration
Swift
func purchase(_ requirement: PurchaseRequirement) -
Called to allow user toggling of the feature
- param defaultValue: The default value to return this constraint if there is no preference stored.
Declaration
Swift
func userToggled(defaultValue: Bool) -
Called to desclare a new permission requirement
Declaration
Swift
func permission(_ permission: SystemPermissionConstraint)
-
permissions(_:)Extension methodCall to declare a list of permissions that your feature requires.
Declaration
Swift
func permissions(_ requirements: SystemPermissionConstraint...) -
purchases(_:)Extension methodCall to declare a list of purchase requirements that your feature requires
Declaration
Swift
func purchases(_ requirements: PurchaseRequirement...) -
purchase(anyOf:)Extension methodConvenience function for use when constructing constraints in the constraints builder, where any of the listed requirements will fulfil the requirement. Used for mixing non-consumable and consumable requirements:
requirements.purchase(anyOf: .init(nonConsumableProduct), .init(creditsProduct, quantity: 5))Declaration
Swift
func purchase(anyOf requirements: PurchaseRequirement...) -
purchase(allOf:)Extension methodConvenience function for use when constructing constraints in the constraints builder, where all of the listed requirements must be fulfilled to fulfil the requirement. Used for mixing non-consumable and consumable requirements:
requirements.purchase(allOf: .init(nonConsumableProduct), .init(creditsProduct, quantity: 5))Declaration
Swift
func purchase(allOf requirements: PurchaseRequirement...) -
purchase(_:quantity:)Extension methodCall to declare a product that your feature requires
Declaration
Swift
func purchase(_ product: ConsumableProduct, quantity: UInt) -
purchases(_:)Extension methodCall to declare a list of products that your feature requires. All must be purchased for the constraint to be met
Declaration
Swift
func purchases(_ products: NonConsumableProduct...) -
purchase(anyOf:)Extension methodConvenience function for use when constructing constraints in the constraints builder, where any of the listed purchases will fulfil the requirement
Declaration
Swift
func purchase(anyOf products: Set<NoQuantityProduct>) -
purchase(anyOf:)Extension methodConvenience function for use when constructing constraints in the constraints builder, where any of the listed purchases will fulfil the requirement
Declaration
Swift
func purchase(anyOf products: NoQuantityProduct...) -
purchase(allOf:)Extension methodConvenience function for use when constructing constraints in the constraints builder, where all of the listed purchases will fulfil the requirement
Declaration
Swift
func purchase(allOf products: NoQuantityProduct...) -
purchase(allOf:)Extension methodConvenience function for use when constructing constraints in the constraints builder, where all of the listed purchases will fulfil the requirement
Declaration
Swift
func purchase(allOf products: Set<NoQuantityProduct>)
-
iOSExtension methodSet this to the minimum iOS version your feature requires
Declaration
Swift
var iOS: PlatformVersionConstraint { get set } -
iOSOnlyExtension methodSet this to the minimum iOS version your feature requires, if it only supports iOS and all other platforms should be set to
.unsupportedDeclaration
Swift
var iOSOnly: PlatformVersionConstraint { get set } -
watchOSExtension methodSet this to the minimum watchOS version your feature requires
Declaration
Swift
var watchOS: PlatformVersionConstraint { get set } -
watchOSOnlyExtension methodSet this to the minimum watchOS version your feature requires, if it only supports watchOS and all other platforms should be set to
.unsupportedDeclaration
Swift
var watchOSOnly: PlatformVersionConstraint { get set } -
tvOSExtension methodSet this to the minimum tvOS version your feature requires
Declaration
Swift
var tvOS: PlatformVersionConstraint { get set } -
tvOSOnlyExtension methodSet this to the minimum tvOS version your feature requires, if it only supports tvOS and all other platforms should be set to
.unsupportedDeclaration
Swift
var tvOSOnly: PlatformVersionConstraint { get set } -
macOSExtension methodSet this to the minimum macOS version your feature requires
Declaration
Swift
var macOS: PlatformVersionConstraint { get set } -
macOSOnlyExtension methodSet this to the minimum macOS version your feature requires, if it only supports macOS and all other platforms should be set to
.unsupportedDeclaration
Swift
var macOSOnly: PlatformVersionConstraint { get set }
View on GitHub
FeatureConstraintsBuilder Protocol Reference