Files
yoga/CSSLayoutKit/UIView+CSSLayout.h
Emil Sjolander 42b6f6b6e5 Rename enums
Summary: new name, start by renaming enums

Differential Revision: D4244360

fbshipit-source-id: c9fcbdd231098c9ff230a6055676bbc7cbd11001
2016-12-02 05:52:59 -08:00

73 lines
2.4 KiB
Objective-C

/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <UIKit/UIKit.h>
#import <CSSLayout/CSSLayout.h>
@interface UIView (CSSLayout)
/**
The property that decides if we should include this view when calculating layout. Defaults to YES.
*/
@property (nonatomic, readwrite, assign, setter=css_setIncludeInLayout:) BOOL css_includeInLayout;
/**
The property that decides during layout/sizing whether or not css_* properties should be applied. Defaults to NO.
*/
@property (nonatomic, readwrite, assign, setter=css_setUsesFlexbox:) BOOL css_usesFlexbox;
- (void)css_setDirection:(YGDirection)direction;
- (void)css_setFlexDirection:(YGFlexDirection)flexDirection;
- (void)css_setJustifyContent:(YGJustify)justifyContent;
- (void)css_setAlignContent:(YGAlign)alignContent;
- (void)css_setAlignItems:(YGAlign)alignItems;
- (void)css_setAlignSelf:(YGAlign)alignSelf;
- (void)css_setPositionType:(YGPositionType)positionType;
- (void)css_setFlexWrap:(YGWrap)flexWrap;
- (void)css_setFlexGrow:(CGFloat)flexGrow;
- (void)css_setFlexShrink:(CGFloat)flexShrink;
- (void)css_setFlexBasis:(CGFloat)flexBasis;
- (void)css_setPosition:(CGFloat)position forEdge:(YGEdge)edge;
- (void)css_setMargin:(CGFloat)margin forEdge:(YGEdge)edge;
- (void)css_setPadding:(CGFloat)padding forEdge:(YGEdge)edge;
- (void)css_setWidth:(CGFloat)width;
- (void)css_setHeight:(CGFloat)height;
- (void)css_setMinWidth:(CGFloat)minWidth;
- (void)css_setMinHeight:(CGFloat)minHeight;
- (void)css_setMaxWidth:(CGFloat)maxWidth;
- (void)css_setMaxHeight:(CGFloat)maxHeight;
// Yoga specific properties, not compatible with flexbox specification
- (void)css_setAspectRatio:(CGFloat)aspectRatio;
/**
Get the resolved direction of this node. This won't be YGDirectionInherit
*/
- (YGDirection)css_resolvedDirection;
/**
Perform a layout calculation and update the frames of the views in the hierarchy with th results
*/
- (void)css_applyLayout;
/**
Returns the size of the view if no constraints were given. This could equivalent to calling [self sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];
*/
- (CGSize)css_intrinsicSize;
/**
Returns the number of children that are using Flexbox.
*/
- (NSUInteger)css_numberOfChildren;
@end