Skip to content

Commit

Permalink
Added barsTranslucent property to SVModalWebViewController
Browse files Browse the repository at this point in the history
  • Loading branch information
ykws committed Dec 11, 2014
1 parent 5be38e4 commit 4fc32ff
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Demo/Classes/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ - (void)presentWebViewController {
NSURL *URL = [NSURL URLWithString:@"http://samvermette.com"];
SVModalWebViewController *webViewController = [[SVModalWebViewController alloc] initWithURL:URL];
webViewController.modalPresentationStyle = UIModalPresentationPageSheet;
webViewController.barsTranslucent = NO;
[self presentViewController:webViewController animated:YES completion:NULL];
}

Expand Down
1 change: 1 addition & 0 deletions SVWebViewController/SVModalWebViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
- (instancetype)initWithURLRequest:(NSURLRequest *)request;

@property (nonatomic, strong) UIColor *barsTintColor;
@property (nonatomic, assign, getter=isBarsTranslucent) BOOL barsTranslucent;

@end
1 change: 1 addition & 0 deletions SVWebViewController/SVModalWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ - (void)viewWillAppear:(BOOL)animated {

self.webViewController.title = self.title;
self.navigationBar.tintColor = self.barsTintColor;
self.navigationBar.translucent = self.barsTranslucent;
}

@end
2 changes: 2 additions & 0 deletions SVWebViewController/SVWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ - (void)updateToolbarItems {
toolbar.items = items;
toolbar.barStyle = self.navigationController.navigationBar.barStyle;
toolbar.tintColor = self.navigationController.navigationBar.tintColor;
toolbar.translucent = self.navigationController.navigationBar.translucent;
self.navigationItem.rightBarButtonItems = items.reverseObjectEnumerator.allObjects;
}

Expand All @@ -211,6 +212,7 @@ - (void)updateToolbarItems {

self.navigationController.toolbar.barStyle = self.navigationController.navigationBar.barStyle;
self.navigationController.toolbar.tintColor = self.navigationController.navigationBar.tintColor;
self.navigationController.toolbar.translucent = self.navigationController.navigationBar.translucent;
self.toolbarItems = items;
}
}
Expand Down

0 comments on commit 4fc32ff

Please sign in to comment.