-
The value wrapped by this instance.
Declaration
Swift
@inlinable public var base: Any { get } -
A string used to identify a element that is reusable. Default is the type name of
self.Declaration
Swift
@inlinable public var reuseIdentifier: String { get } -
Create a type-erased component that wraps the given instance.
Declaration
Swift
@inlinable public init<Base>(_ base: Base) where Base : ComponentParameters
baseA component to be wrap.
-
Returns a new instance of
Content.Declaration
Swift
@inlinable public func renderContent() -> AnyReturn Value
A new
Contentinstance for render on top of element of list UI element. -
Render properties into the content on the element of list UI.
Declaration
Swift
@inlinable public func render(in content: Any) -
Returns the referencing size of content to render on the list UI.
Declaration
Swift
@inlinable public func referenceSize(in bounds: CGRect) -> CGSize?Return Value
The referencing size of content to render on the list UI. If returns nil, the element of list UI falls back to its default size like
UITableView.rowHeightorUICollectionViewFlowLayout.itemSize. -
Returns a
Boolvalue indicating whether the content should be reloaded.Note
Unlike
Equatable, this doesn’t compare whether the two values exactly equal. It’s can be ignore property comparisons, if not expect to reload content.Declaration
Swift
@inlinable public func shouldContentUpdate(with next: AnyComponent) -> BoolReturn Value
A
Boolvalue indicating whether the content should be reloaded. -
Returns a
Boolvalue indicating whether component should be render again.Declaration
Swift
@inlinable public func shouldRender(next: AnyComponent, in content: Any) -> BoolParameters
nextThe next value to be compared to the receiver.
contentAn instance of content laid out on the element.
Return Value
A
Boolvalue indicating whether the component should be render again. -
Layout the content on top of element of the list UI.
Note
UIViewandUIViewControllerare laid out with edge constraints by default.Declaration
Swift
@inlinable public func layout(content: Any, in container: UIView)Parameters
contentAn instance of content to be laid out on top of element.
containerA container view to layout content.
-
The natural size for the passed content.
Declaration
Swift
@inlinable public func intrinsicContentSize(for content: Any) -> CGSizeReturn Value
A
CGSizevalue represents a natural size of the passed content. -
Invoked every time of before a component got into visible area.
Declaration
Swift
@inlinable public func contentWillDisplay(_ content: Any) -
Invoked every time of after a component went out from visible area.
Declaration
Swift
@inlinable public func contentDidEndDisplay(_ content: Any) -
Returns a base instance casted as given type if possible.
Declaration
Swift
@inlinable public func `as`<T>(_: T.Type) -> T?Return Value
A casted base instance.
-
A textual representation of this instance, suitable for debugging.
Declaration
Swift
public var debugDescription: String { get }
View on GitHub
AnyComponent Structure Reference