2019-06-06 19:36:56 -07:00
|
|
|
/*
|
2022-10-04 13:59:32 -07:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2016-12-02 11:18:15 -08:00
|
|
|
*
|
2019-10-15 10:30:08 -07:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2016-12-02 11:18:15 -08:00
|
|
|
*/
|
2019-10-15 10:30:08 -07:00
|
|
|
|
2017-01-31 09:28:10 -08:00
|
|
|
#import <UIKit/UIKit.h>
|
2020-02-18 08:09:53 -08:00
|
|
|
#import "YGLayout.h"
|
2016-12-02 11:18:15 -08:00
|
|
|
|
2017-02-13 09:16:22 -08:00
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
2020-02-18 08:09:53 -08:00
|
|
|
typedef void (^YGLayoutConfigurationBlock)(YGLayout* layout);
|
2017-02-13 09:16:22 -08:00
|
|
|
|
2016-12-03 04:40:18 -08:00
|
|
|
@interface UIView (Yoga)
|
2016-12-02 11:18:15 -08:00
|
|
|
|
2017-02-13 09:16:22 -08:00
|
|
|
/**
|
|
|
|
The YGLayout that is attached to this view. It is lazily created.
|
|
|
|
*/
|
2020-02-18 08:09:53 -08:00
|
|
|
@property(nonatomic, readonly, strong) YGLayout* yoga;
|
2017-09-21 09:58:08 -07:00
|
|
|
/**
|
|
|
|
Indicates whether or not Yoga is enabled
|
|
|
|
*/
|
2020-02-18 08:09:53 -08:00
|
|
|
@property(nonatomic, readonly, assign) BOOL isYogaEnabled;
|
2017-01-05 08:25:01 -08:00
|
|
|
|
2017-02-13 09:16:22 -08:00
|
|
|
/**
|
2020-02-18 08:09:53 -08:00
|
|
|
In ObjC land, every time you access `view.yoga.*` you are adding another
|
|
|
|
`objc_msgSend` to your code. If you plan on making multiple changes to
|
|
|
|
YGLayout, it's more performant to use this method, which uses a single
|
|
|
|
objc_msgSend call.
|
2017-02-13 09:16:22 -08:00
|
|
|
*/
|
2017-02-14 09:16:59 -08:00
|
|
|
- (void)configureLayoutWithBlock:(YGLayoutConfigurationBlock)block
|
|
|
|
NS_SWIFT_NAME(configureLayout(block:));
|
2017-02-13 09:16:22 -08:00
|
|
|
|
2016-12-02 11:18:15 -08:00
|
|
|
@end
|
2017-02-13 09:16:22 -08:00
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|