Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/transitapp/svwebviewcontroller
A drop-in inline browser for your iOS app.
https://github.com/transitapp/svwebviewcontroller
Last synced: 6 days ago
JSON representation
A drop-in inline browser for your iOS app.
- Host: GitHub
- URL: https://github.com/transitapp/svwebviewcontroller
- Owner: TransitApp
- License: mit
- Created: 2011-02-24T07:36:06.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2020-04-30T03:24:05.000Z (almost 5 years ago)
- Last Synced: 2025-01-28T01:14:00.464Z (25 days ago)
- Language: Objective-C
- Homepage:
- Size: 232 KB
- Stars: 2,570
- Watchers: 117
- Forks: 514
- Open Issues: 77
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# SVWebViewController
SVWebViewController is a simple inline browser for your iOS 7 app.

**SVWebViewController features:**
* iPhone and iPad distinct UIs
* full landscape orientation support
* back, forward, stop/refresh and share buttons
* Open in Safari and Chrome UIActivities
* navbar title set to the currently visible web page
* talks with `setNetworkActivityIndicatorVisible`## Installation
### CocoaPods
I'm not a big fan of CocoaPods, so tend to not keep it updated. If you really want to use SVWebViewController with CocoaPods, I suggest you use `pod 'SVWebViewController', :head` to pull from the `master` branch directly. I'm usually careful about what I push there and is the version I use myself in all my projects.
### Manually
* Drag the `SVWebViewController/SVWebViewController` folder into your project.
* `#import "SVWebViewController.h"`## Usage
(see sample Xcode project in `/Demo`)
Just like any UIViewController, SVWebViewController can be pushed into a UINavigationController stack:
```objective-c
SVWebViewController *webViewController = [[SVWebViewController alloc] initWithAddress:@"http://google.com"];
[self.navigationController pushViewController:webViewController animated:YES];
```It can also be presented modally using `SVModalWebViewController`:
```objective-c
SVModalWebViewController *webViewController = [[SVModalWebViewController alloc] initWithAddress:@"http://google.com"];
[self presentViewController:webViewController animated:YES completion:NULL];
```### SVWebViewControllerActivity
Starting in iOS 6 Apple uses `UIActivity` to let you show additional sharing methods in share sheets. `SVWebViewController` comes with "Open in Safari" and "Open in Chrome" activities. You can easily add your own activity by subclassing `SVWebViewControllerActivity` which takes care of a few things automatically for you. Have a look at the Safari and Chrome activities for implementation examples. Feel free to send it as a pull request once you're done!
## Credits
SVWebViewController is brought to you by [Sam Vermette](http://samvermette.com) and [contributors to the project](https://github.com/samvermette/SVWebViewController/contributors). If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by [creating new issues](https://github.com/samvermette/SVWebViewController/issues/new). If you're using SVWebViewController in your project, attribution is always appreciated.