Skip to content

pellet/SVWebViewController

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ben Pettit’s SVWebViewController fork

This is a fork of Sam Vermette and Blork’s SVWebViewController with a few main differences in mind:

  • This version does not support any version of iOS previous to ios6.
  • Added UI State Restoration support.
  • Added support calling the UIWebView didFinishLoading delegate on all pages loaded including HTML5 pages such as on YouTube.
  • Added support for page change notifications delivered via a delegate.
  • Added feature of automatically redirecting to the HTTPS protocol rather than the HTTP protocol if supported/desired.
  • Added address bar object which can double as a search bar.

SVWebViewController features:

  • iPhone and iPad distinct UIs
  • full landscape orientation support
  • back, forward, stop/refresh and action buttons (with actions “Open in Safari” and “Mail Link”)
  • navbar title set to the currently visible web page
  • talks with setNetworkActivityIndicatorVisible

Installation

  • Drag the SVWebViewController/SVWebViewController folder into your project.
  • Add the MessageUI framework to your project

Usage

(see sample Xcode project in /Demo)

Just like any UIViewController, SVWebViewController can be pushed into a UINavigationController stack:

SVWebViewController *webViewController = [[SVWebViewController alloc] initWithAddress:@"http://google.com"];
[self.navigationController pushViewController:webViewController animated:YES];
[webViewController release];

It can also be presented modally using SVModalWebViewController:

SVModalWebViewController *webViewController = [[SVModalWebViewController alloc] initWithAddress:@"http://google.com"];
[self presentModalViewController:webViewController animated:YES];	
[webViewController release];

Changing the bars tint color

Only SVModalWebViewController supports custom tint colors using the barsTintColor property.

Customizing the action sheet

Use the availableActions integer bit mask property to set which actions should be available for display:

enum {
    SVWebViewControllerAvailableActionsNone             = 0,
    SVWebViewControllerAvailableActionsOpenInSafari     = 1 << 0,
    SVWebViewControllerAvailableActionsMailLink         = 1 << 1,
    SVWebViewControllerAvailableActionsCopyLink         = 1 << 2
};

Default is SVWebViewControllerAvailableActionsOpenInSafari | SVWebViewControllerAvailableActionsMailLink.

Credits

SVWebViewController is brought to you by Sam Vermette and contributors to the project. If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by creating new issues. If you’re using SVWebViewController in your project, attribution would be nice.

About

A drop-in inline browser for your iOS app.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 100.0%