Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Added barsTranslucent property to SVModalWebViewController
fixes #116
  • Loading branch information
ykws committed Dec 11, 2014
commit 4fc32ffad12f9a9ca6d8ba651966d3dfb5b9947c
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