Summary: This is an update of facebook/yoga#368 which was reverted. It fixes support for align-content: strech with multiple lines. The problem with the last attempt at solving this was that align-items:stretch was interfering. We handle this now by detecting when the flex basis of the children hints at them overflowing. This is not 100% correct as the size of the items could change when remeasuring but it will work in 99% of cases. Reviewed By: astreet Differential Revision: D4551234 fbshipit-source-id: 2964f19cf415991dc55dfa2caa4868cb00c56bd0
35 lines
981 B
Objective-C
35 lines
981 B
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 "YGLayout.h"
|
|
#import <UIKit/UIKit.h>
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
typedef void (^YGLayoutConfigurationBlock)(YGLayout *);
|
|
|
|
@interface UIView (Yoga)
|
|
|
|
/**
|
|
The YGLayout that is attached to this view. It is lazily created.
|
|
*/
|
|
@property (nonatomic, readonly, strong) YGLayout *yoga;
|
|
|
|
/**
|
|
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.
|
|
*/
|
|
- (void)configureLayoutWithBlock:(YGLayoutConfigurationBlock)block
|
|
NS_SWIFT_NAME(configureLayout(block:));
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|