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 isEnabled every time availability checking is performed

    Declaration

    Swift

    func runtimeEnabled()
  • purchase(_:) Default implementation

    Called 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 method

    Call to declare a list of permissions that your feature requires.

    Declaration

    Swift

    func permissions(_ requirements: SystemPermissionConstraint...)
  • purchases(_:) Extension method

    Call to declare a list of purchase requirements that your feature requires

    Declaration

    Swift

    func purchases(_ requirements: PurchaseRequirement...)
  • purchase(anyOf:) Extension method

    Convenience 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 method

    Convenience 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 method

    Call to declare a product that your feature requires

    Declaration

    Swift

    func purchase(_ product: ConsumableProduct, quantity: UInt)
  • purchases(_:) Extension method

    Call 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 method

    Convenience 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 method

    Convenience 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 method

    Convenience 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 method

    Convenience 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>)