File tree 2 files changed +25
-1
lines changed
playground/ios/NavigationTests
2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -115,14 +115,17 @@ - (void)setTitleAttributes:(RNNTitleOptions *)titleOptions {
115
115
NSNumber *fontSize = [titleOptions.fontSize getWithDefaultValue: nil ];
116
116
UIColor *fontColor = [titleOptions.color getWithDefaultValue: nil ];
117
117
118
- self. getAppearance . titleTextAttributes =
118
+ NSDictionary * titleTextAttributes =
119
119
[RNNFontAttributesCreator createFromDictionary: self .getAppearance.titleTextAttributes
120
120
fontFamily: fontFamily
121
121
fontSize: fontSize
122
122
defaultFontSize: nil
123
123
fontWeight: fontWeight
124
124
color: fontColor
125
125
defaultColor: nil ];
126
+
127
+ self.getAppearance .titleTextAttributes = titleTextAttributes;
128
+ self.getScrollEdgeAppearance .titleTextAttributes = titleTextAttributes;
126
129
}
127
130
128
131
- (void )setLargeTitleAttributes : (RNNLargeTitleOptions *)largeTitleOptions {
Original file line number Diff line number Diff line change @@ -106,4 +106,25 @@ - (void)testShowBorder_shouldPreserveBorderColor {
106
106
UIColor.blueColor );
107
107
}
108
108
109
+ - (void )testMergeOptions_shouldApplyTitleAppearance {
110
+ RNNNavigationOptions *options = [RNNNavigationOptions emptyOptions ];
111
+ options.topBar .title .color = [Color withColor: UIColor.redColor];
112
+ options.topBar .title .fontSize = [Number withValue: @(21 )];
113
+
114
+ [_uut applyOptions: options.topBar];
115
+ XCTAssertEqual (_stack.childViewControllers .lastObject .navigationItem .standardAppearance
116
+ .titleTextAttributes [NSForegroundColorAttributeName ],
117
+ UIColor.redColor );
118
+ XCTAssertEqual ([_stack.childViewControllers.lastObject.navigationItem.standardAppearance
119
+ .titleTextAttributes[NSFontAttributeName ] pointSize ],
120
+ 21 );
121
+
122
+ XCTAssertEqual (_stack.childViewControllers .lastObject .navigationItem .scrollEdgeAppearance
123
+ .titleTextAttributes [NSForegroundColorAttributeName ],
124
+ UIColor.redColor );
125
+ XCTAssertEqual ([_stack.childViewControllers.lastObject.navigationItem.scrollEdgeAppearance
126
+ .titleTextAttributes[NSFontAttributeName ] pointSize ],
127
+ 21 );
128
+ }
129
+
109
130
@end
You can’t perform that action at this time.
0 commit comments