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

A modal view controller for showing websites - inspired by the Facebook app

License

Notifications You must be signed in to change notification settings

boserup/JBWebViewController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JBWebViewController

A drop-in Facebook inspired modal web browser.

JBWebViewController Screenshot

Video Demo

JBWebViewController Video Demo

Installation

CocoaPods

The recommended approach for installing JBWebViewController is through the package manager CocoaPods, which is widely used by iOS & Mac developers.

Simply add the following line to your Podfile:

pod "JBWebViewController"

Manual Install

Drag the JBWebViewController folder into your Xcode project, you may need to check the box "Copy items into destination group's folder (if needed)".

JBWebViewController needs the following third-party libraries:

Apps using JBWebViewController

Feel free to add your app to the list.

How to use

JBWebViewController is ment to be shown modally, which is recommended to be down with it's built in show functionality. Whilst not being recommended, it is however possible to present JBWebViewController outside a modal view controller. JBWebViewController should always be connected to a UINavigationController.

Presenting JBWebViewController

JBWebViewController *controller = [[JBWebViewController alloc] initWithUrl:[NSURL URLWithString:@"http://www.apple.com/iphone/"]];

[controller show];

Presenting JBWebViewController with block

JBWebViewController *controller = [[JBWebViewController alloc] initWithUrl:[NSURL URLWithString:@"http://www.apple.com/iphone/"]];

[controller showControllerWithCompletion:^(JBWebViewController *controller) {
    NSLog(@"Controller has arrived.");
}];

Localization

[controller setLoadingString:@"Chargement.."];

Navigate to URL

[controller navigateToURL:[NSURL URLWithString:@"http://www.apple.com/ios/"]];

Load custom NSURLRequest

NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://developer.apple.com/"]];
[controller loadRequest:request];

Reload current page

[controller reload];

Manually setting controller title

[controller setWebTitle:@"The quick brown fox"];

Getting controller title

NSString *controllerTitle = [controller getWebTitle];

Manually setting controller subtitle

[controller setWebSubtitle:@"foo bar"];

Getting controller subtitle

NSString *controllerSubtitle = [controller getWebSubtitle];

Hide URL

controller.hideAddressBar = YES;

Access UIWebView

The UIWebView used in the controller is now public.

UIWebView *webView;

Icons

Free icons by Icons8 under Creative Commons Attribution-NoDerivs 3.0 Unported.

Contact

Mention me on Twitter (@JonasBoserup) or email me (Profile).

License

JBWebViewController is available under the MIT license. See the LICENSE file for more info.

About

A modal view controller for showing websites - inspired by the Facebook app

Resources

License

Stars

Watchers

Forks

Packages

No packages published