Skip to content

Commit

Permalink
fix #4625 (#5398)
Browse files Browse the repository at this point in the history
* fix #4625

* fixed renamed property
  • Loading branch information
FRizzonelli authored and guyca committed Aug 22, 2019
1 parent 5b24982 commit b434b4f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions lib/ios/RNNViewControllerPresenter.m
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ - (void)mergeOptions:(RNNNavigationOptions *)newOptions currentOptions:(RNNNavig

if (newOptions.topBar.title.component.name.hasValue) {
[self setCustomNavigationTitleView:newOptions perform:nil];
} else {
[_customTitleView removeFromSuperview];
_customTitleView = nil;
}

if (newOptions.topBar.backButton.icon.hasValue || newOptions.topBar.backButton.showTitle.hasValue || newOptions.topBar.backButton.color.hasValue || newOptions.topBar.backButton.title.hasValue) {
Expand Down Expand Up @@ -191,10 +194,20 @@ - (void)setCustomNavigationTitleView:(RNNNavigationOptions *)options perform:(RN
}

- (void)setTitleViewWithSubtitle:(RNNNavigationOptions *)options {
if (!_customTitleView && options.topBar.subtitle.text.hasValue) {
if (!_customTitleView) {
_titleViewHelper = [[RNNTitleViewHelper alloc] initWithTitleViewOptions:options.topBar.title subTitleOptions:options.topBar.subtitle viewController:self.boundViewController];

if (options.topBar.title.text.hasValue) {
[_titleViewHelper setTitleOptions:options.topBar.title];
}
if (options.topBar.subtitle.text.hasValue) {
[_titleViewHelper setSubtitleOptions:options.topBar.subtitle];
}

[_titleViewHelper setup];
} else if (_titleViewHelper) {
} else {
_titleViewHelper = [[RNNTitleViewHelper alloc] initWithTitleViewOptions:options.topBar.title subTitleOptions:options.topBar.subtitle viewController:self.boundViewController];

if (options.topBar.title.text.hasValue) {
[_titleViewHelper setTitleOptions:options.topBar.title];
}
Expand Down

0 comments on commit b434b4f

Please sign in to comment.