Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions React/Views/RCTComponentData.m
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,8 @@ - (RCTPropBlock)propBlockForKey:(NSString *)name
setterBlock = ^(id target, id json) { \
if (json) { \
if (!setDefaultValue && target) { \
if ([target respondsToSelector:getter]) { \
defaultValue = get(target, getter); \
} \
RCTAssert([target respondsToSelector:getter], @"prop getter does not exist: %@", NSStringFromSelector(getter)); \
defaultValue = get(target, getter); \
setDefaultValue = YES; \
} \
set(target, setter, convert([RCTConvert class], type, json)); \
Expand Down
5 changes: 5 additions & 0 deletions React/Views/RCTShadowView.m
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,11 @@ - (void)setFlex:(float)value
YGNodeStyleSetFlex(_cssNode, value);
}

- (float)flex
{
return YGNodeStyleGetFlex(_cssNode);
}

- (void)setFlexBasis:(YGValue)value
{
RCT_SET_YGVALUE(value, YGNodeStyleSetFlexBasis, _cssNode);
Expand Down
6 changes: 6 additions & 0 deletions React/Views/RCTSwitch.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

@implementation RCTSwitch

// `on` is a component prop, so we must expose symmetrical `on` and `setOn` methods.
// UIView breaks convention with the name `isOn`, so we simply forward.
- (BOOL)on {
return [self isOn];
}

- (void)setOn:(BOOL)on animated:(BOOL)animated {
_wasOn = on;
[super setOn:on animated:animated];
Expand Down
9 changes: 9 additions & 0 deletions React/Views/RCTTabBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ - (void)setTranslucent:(BOOL)translucent {
_tabController.tabBar.translucent = translucent;
}

- (UIColor *)unselectedItemTintColor {
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
if ([_tabController.tabBar respondsToSelector:@selector(unselectedItemTintColor)]) {
return _tabController.tabBar.unselectedItemTintColor;
}
#endif
return nil;
}

- (void)setUnselectedItemTintColor:(UIColor *)unselectedItemTintColor {
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
if ([_tabController.tabBar respondsToSelector:@selector(unselectedItemTintColor)]) {
Expand Down
4 changes: 4 additions & 0 deletions ReactCommon/yoga/yoga/Yoga.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@ void YGNodeStyleSetFlex(const YGNodeRef node, const float flex) {
}
}

float YGNodeStyleGetFlex(const YGNodeRef node) {
return node->style.flex;
}

#define YG_NODE_PROPERTY_IMPL(type, name, paramName, instanceName) \
void YGNodeSet##name(const YGNodeRef node, type paramName) { \
node->instanceName = paramName; \
Expand Down
1 change: 1 addition & 0 deletions ReactCommon/yoga/yoga/Yoga.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ YG_NODE_STYLE_PROPERTY(YGOverflow, Overflow, overflow);
YG_NODE_STYLE_PROPERTY(YGDisplay, Display, display);

WIN_EXPORT void YGNodeStyleSetFlex(const YGNodeRef node, const float flex);
WIN_EXPORT float YGNodeStyleGetFlex(const YGNodeRef node);
YG_NODE_STYLE_PROPERTY(float, FlexGrow, flexGrow);
YG_NODE_STYLE_PROPERTY(float, FlexShrink, flexShrink);
YG_NODE_STYLE_PROPERTY_UNIT(YGValue, FlexBasis, flexBasis);
Expand Down