CKInsetComponent Class Reference

Inherits from CKLayoutComponent : CKComponent : NSObject
Declared in CKInsetComponent.h

Overview

@uidocs https://fburl.com/CKInsetComponent:ac83

A component that wraps another component, applying insets around it.

If the child component has a size specified as a percentage, the percentage is resolved against this component’s parent size after applying insets.

@note CKOuterComponent contains an CKInsetComponent with an CKInnerComponent. Suppose that: - CKOuterComponent is 200pt wide. - CKInnerComponent specifies its width as 100%. - The CKInsetComponent has insets of 10pt on every side. CKInnerComponent will have size 180pt, not 200pt, because it receives a parent size that has been adjusted for insets.

If you’re familiar with CSS: CKInsetComponent’s child behaves similarly to “box-sizing: border-box”.

An infinite inset is resolved as an inset equal to all remaining space after applying the other insets and child size. @note An CKInsetComponent with an infinite left inset and 10px for all other edges will position it’s child 10px from the right edge.

– initWithSwiftView:insets:component:

Passed to CKComponent -initWithView:size:. The view, if any, will extend outside the insets.

- (instancetype)initWithSwiftView:(CKComponentViewConfiguration_SwiftBridge *_Nullable)swiftView insets:(UIEdgeInsets)insets component:(CKComponent *_Nullable)component

Parameters

swiftView

Passed to CKComponent -initWithView:size:. The view, if any, will extend outside the insets.

insets

The amount of space to inset on each side.

component

The wrapped child component to inset. If nil, this method returns nil.

Declared In

CKInsetComponent.h

– initWithView:top:left:bottom:right:component:

Passed to CKComponent +newWithView:size:. The view, if any, will extend outside the insets.

- (instancetype)initWithView:(const CKComponentViewConfiguration &)view top:(CKRelativeDimension)top left:(CKRelativeDimension)left bottom:(CKRelativeDimension)bottom right:(CKRelativeDimension)right component:(CKComponent *_Nullable)component

Parameters

view

Passed to CKComponent +newWithView:size:. The view, if any, will extend outside the insets.

component

The wrapped child component to inset. If nil, this method returns nil.

insets

The amount of space to inset on each side.

Declared In

CKInsetComponent.h

– initWithTop:left:bottom:right:component:

The amount of space to inset on each side.

- (instancetype)initWithTop:(CKRelativeDimension)top left:(CKRelativeDimension)left bottom:(CKRelativeDimension)bottom right:(CKRelativeDimension)right component:(CKComponent *_Nullable)component

Parameters

component

The wrapped child component to inset. If nil, this method returns nil.

insets

The amount of space to inset on each side.

Declared In

CKInsetComponent.h