SVWebViewController
  • October 27, 2023

SVWebViewController is a simple inline browser for your iOS 7 app.

SVWebViewController

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:

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

It can also be presented modally using SVModalWebViewController:

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!

GitHub


View Github

#browser #cocoapods #ios #swift #uiwebviewcontroller
YOU MIGHT ALSO LIKE...
exyte

     

camerakit-ios

CameraKit helps you add reliable camera to your app quickly. Our open source camera platform provides consistent capture results, service ...

HybridCamera

[video width="192" height="416" mp4="https://swiftgit.com/wp-content/uploads/2024/12/68747470733a2f2f7261776769742e636f6d2f7374796c656b69742f696d672f6d61737465722f7669645f6564697465645f325f326d622e676966.mp4"][/video]

TakeASelfie

An iOS framework that uses the front camera, detects your face and takes a selfie. This api opens the front ...

iOS-Depth-Sampler

Code examples of Depth APIs in iOS