DHDeclarable

Declarative UIKit for iOS apps

View the Project on GitHub dan-hart/DHDeclarable

EXTENSION

ObjectDHDeclarable

public extension ObjectDHDeclarable

Methods

declaredWith(_:)

@discardableResult func declaredWith(_ then: (_ instance: Self) -> Void) -> Self

Provides a then to configure instances inline.

Parameters

Name Description
then A then self as the argument.

declaredIf(_:_:)

@discardableResult func declaredIf(_ value: Bool, _ then: (_ instance: Self) -> Void) -> Self

Provides a then to configure instance inline based on a boolean test

Parameters

Name Description
then A then self as the argument if the boolean test is true

declaredIf(_:_:otherwise:)

@discardableResult func declaredIf(_ value: Bool, _ then: (_ instance: Self) -> Void, otherwise: ((_ instance: Self) -> Void)?) -> Self

Provides a then to configure instance inline based on a boolean test

Parameters

Name Description
then A then self as the argument if the boolean test is true
otherwise A then self as the argument if the boolean test is false