Skip to content
This repository was archived by the owner on Nov 15, 2018. It is now read-only.

Frameworks support #24

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion JBWebViewController.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = "JBWebViewController"
s.version = "1.0.8"
s.version = "1.0.9"
s.summary = "A modal view controller for showing websites - inspired by the Facebook app"
s.description = <<-DESC
A drop-in Facebook inspired modal web browser.
Expand Down
36 changes: 30 additions & 6 deletions JBWebViewController/JBWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,21 @@ - (void)setup {
self.navigationItem.titleView = _titleView;

// Inset right buttons
UIBarButtonItem *shareButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Share"] style:UIBarButtonItemStylePlain target:self action:@selector(share)];
UIBarButtonItem *dismissButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Dismiss"] style:UIBarButtonItemStylePlain target:self action:@selector(dismiss)];
[self.navigationItem setRightBarButtonItems:[NSArray arrayWithObjects:dismissButton, shareButton, nil]];
UIImage *shareImage = [UIImage imageNamed:@"Share"
inBundle:[NSBundle bundleForClass:[JBWebViewController class]]
compatibleWithTraitCollection:nil];
UIBarButtonItem *shareButton = [[UIBarButtonItem alloc] initWithImage:shareImage
style:UIBarButtonItemStylePlain
target:self
action:@selector(share)];
UIImage *dismissImage = [UIImage imageNamed:@"Dismiss"
inBundle:[NSBundle bundleForClass:[JBWebViewController class]]
compatibleWithTraitCollection:nil];
UIBarButtonItem *dismissButton = [[UIBarButtonItem alloc] initWithImage:dismissImage
style:UIBarButtonItemStylePlain
target:self
action:@selector(dismiss)];
[self.navigationItem setRightBarButtonItems:@[dismissButton, shareButton]];

// Add a webview
_webView = [[UIWebView alloc] initWithFrame:self.view.frame];
Expand Down Expand Up @@ -273,11 +285,23 @@ - (void)adjustNavigationbar {

- (void)addNavigationButtonsButtons {
// Creating buttons
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Back"] style:UIBarButtonItemStylePlain target:self action:@selector(navigateBack)];
UIBarButtonItem *forwardButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Forward"] style:UIBarButtonItemStylePlain target:self action:@selector(navigateForward)];
UIImage *backImage = [UIImage imageNamed:@"Back"
inBundle:[NSBundle bundleForClass:[JBWebViewController class]]
compatibleWithTraitCollection:nil];
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithImage:backImage
style:UIBarButtonItemStylePlain
target:self
action:@selector(navigateBack)];
UIImage *forwardImage = [UIImage imageNamed:@"Forward"
inBundle:[NSBundle bundleForClass:[JBWebViewController class]]
compatibleWithTraitCollection:nil];
UIBarButtonItem *forwardButton = [[UIBarButtonItem alloc] initWithImage:forwardImage
style:UIBarButtonItemStylePlain
target:self
action:@selector(navigateForward)];

// Adding buttons to NavigationBar
[self.navigationItem setLeftBarButtonItems:[NSArray arrayWithObjects:backButton, forwardButton, nil]];
[self.navigationItem setLeftBarButtonItems:@[backButton, forwardButton]];

// Remember that we have extra buttons now
_hasExtraButtons = YES;
Expand Down