Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A drop-in inline browser for your iOS app.
Objective-C
branch: master

This branch is 84 commits behind TransitApp:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Demo
SVWebViewController
.gitignore
LICENSE.txt
README.textile

README.textile

Important note if your project doesn’t use ARC: you must add the -fobjc-arc compiler flag to SVWebViewController.m and SVModalWebViewController.m in Target Settings > Build Phases > Compile Sources.

SVWebViewController

is a simple inline browser for iOS. The iPhone UI is highly based on Tweetie’s inline browser, and the iPad version on Reeder.

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”)
  • “Open in Chrome” action button if Google Chrome is installed (by alexruperez)
  • 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,
    SVWebViewControllerAvailableActionsOpenInChrome     = 1 << 3
};

Default is SVWebViewControllerAvailableActionsOpenInSafari | SVWebViewControllerAvailableActionsOpenInChrome | 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.

Something went wrong with that request. Please try again.