CKYogaBasedComponentProtocol Protocol Reference

Conforms to NSObject
Declared in CKComponent+Yoga.h

Overview

A protocol that is used for the components that are powered by Yoga layout engine (https://github.com/facebook/yoga).

– isYogaBasedLayout required method

A flag that represents whether the component’s layout is based on Yoga.

- (BOOL)isYogaBasedLayout

Discussion

The default value is NO

Declared In

CKComponent+Yoga.h

– nodeSize required method

CKComponentSize of yoga node of the component. For CKComponent it is just it’s size that is passed in the constructor. For wrapper components, like CKCompositeComponent it’s the node size of it’s child component

- (CKComponentSize)nodeSize

Declared In

CKComponent+Yoga.h

– ygNode: required method

A method that returns a new yoga node for a constained size.

- (YGNodeRef _Nonnull)ygNode:(CKSizeRange)constrainedSize

Discussion

By default returns a Yoga node with default configuration

Declared In

CKComponent+Yoga.h

– layoutFromYgNode:thatFits: required method

A method to create a component layout instance from the given node and constrained size.

- (CKLayout)layoutFromYgNode:(YGNodeRef _Nonnull)layoutNode thatFits:(CKSizeRange)constrainedSize

Discussion

By default returns an empty layout

Declared In

CKComponent+Yoga.h

– usesCustomBaseline required method

A flag that represents whether the component’s layout sets a custom baseline value using the key [kCKComponentLayoutExtraBaselineKey] or not

- (BOOL)usesCustomBaseline

Discussion

The default value is NO

Declared In

CKComponent+Yoga.h