2017-12-04 13:31:40 -08:00
|
|
|
/**
|
2018-09-11 15:27:47 -07:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2017-12-04 13:31:40 -08:00
|
|
|
*
|
2018-02-16 18:24:55 -08: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 13:31:40 -08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
|
2018-01-11 18:34:34 -08:00
|
|
|
#import <React/RCTDefines.h>
|
|
|
|
|
2017-12-04 13:31:40 -08: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-11 18:34:34 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns size constraints based on `size` and `sizeMeasureMode`.
|
|
|
|
*/
|
|
|
|
RCT_EXTERN void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
|
|
|
|
CGSize size,
|
|
|
|
RCTSurfaceSizeMeasureMode sizeMeasureMode,
|
2018-04-08 22:57:49 -07:00
|
|
|
CGSize *minimumSize,
|
|
|
|
CGSize *maximumSize
|
2018-01-11 18:34:34 -08:00
|
|
|
);
|