2017-12-04 21:31:40 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2017-12-04 21:31:40 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
|
2018-01-12 02:34:34 +00:00
|
|
|
#import <React/RCTDefines.h>
|
|
|
|
|
2017-12-04 21:31:40 +00:00
|
|
|
/**
|
|
|
|
* Bitmask defines how size constrains from `-[UIView sizeThatFits:]`
|
|
|
|
* are translated to `-[RCTSurface sizeThatFitsMinimumSize:maximumSize:]`.
|
|
|
|
*/
|
|
|
|
typedef NS_OPTIONS(NSInteger, RCTSurfaceSizeMeasureMode) {
|
|
|
|
RCTSurfaceSizeMeasureModeWidthUndefined = 0 << 0,
|
|
|
|
RCTSurfaceSizeMeasureModeWidthExact = 1 << 0,
|
|
|
|
RCTSurfaceSizeMeasureModeWidthAtMost = 2 << 0,
|
|
|
|
RCTSurfaceSizeMeasureModeHeightUndefined = 0 << 2,
|
|
|
|
RCTSurfaceSizeMeasureModeHeightExact = 1 << 2,
|
|
|
|
RCTSurfaceSizeMeasureModeHeightAtMost = 2 << 2,
|
|
|
|
};
|
2018-01-12 02:34:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns size constraints based on `size` and `sizeMeasureMode`.
|
|
|
|
*/
|
|
|
|
RCT_EXTERN void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
|
|
|
|
CGSize size,
|
|
|
|
RCTSurfaceSizeMeasureMode sizeMeasureMode,
|
2018-04-09 05:57:49 +00:00
|
|
|
CGSize *minimumSize,
|
|
|
|
CGSize *maximumSize
|
2018-01-12 02:34:34 +00:00
|
|
|
);
|