A drop-in inline browser for your iOS app.

Overview

SVWebViewController

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!

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 is always appreciated.

Comments
  • Releasing navItem too early, bad access

    Releasing navItem too early, bad access

    So at least on an iphone, when the web view controller is introduced without a navigation controller (for instance, if it's presented modally) you create a new nav bar and nav item, and then release the nav item ... but then in setupToolbar, you access navItem again, after it's been released.

    opened by grgcombs 13
  • Checks for modal NavigationController

    Checks for modal NavigationController

    Added Checks for a modal presented Controller. If the WebView has been pushed, the 'Done' button will not be presented and the back button will be respected.

    opened by gamma 9
  • EXC_BAD_ACCESS due to deferred delegate callbacks

    EXC_BAD_ACCESS due to deferred delegate callbacks

    If you present the non-modal (didn't try the modal) VC like so:

    SVWebViewController *vc = [[[SVWebViewController alloc] initWithAddress:@"http://www.someslowsite.com"] autorelease]; [self.navigationController pushViewController:vc animated:YES];

    Then quickly hit the Back button while the site is loading, you can often get a bad access fault thrown. This was tracked down to not clearing the delegate (mainWebView.delegate = nil;) before the VC gets autoreleased.

    Not sure where the best place to implement this fix would be but I put it in viewWillDisappear: and re-registered the delegate in viewWillAppear: because there's no existing dealloc method.

    opened by dmcdonx 8
  • Large amount of additions

    Large amount of additions

    Hi Sam, I have added better support for page loading within a html5 site, such as on youtube. The pageFinishedLoading delegate would not be called after a page has loaded, so I attached an observer to the WebProgressEstimateChangedNotification to call the delegate.

    I've also made many changes to the SVModalWebView class to add a navbar and have it's settings controlled by a separate SVWebSettings object.

    I was hoping you would like to merge some of these changes when you get the time.

    Cheers! Ben.

    opened by pellet 7
  • WebView not working in iOS 9

    WebView not working in iOS 9

    Hello there,

    I was wondering if you noticed that this library is not working properly in iOS 9. When webview is loaded, it only shows the blank screen in the device or simulator. It was working fine up to iOS 8.4. ios8 ios9

    opened by sgrmhn 5
  • Allow overriding request loading logic in subclasses

    Allow overriding request loading logic in subclasses

    We use SVWebViewController to access pages from our website that require authentication. In order to ensure the user is authenticated, we have to first make an API call before the page is loaded in the WebView.

    We tried making the API call before loading SVWebViewController, but it adds perceived latency, so instead we decided to handle the authenticating API call at the point where the view is actually loaded.

    This PR just defines -loadURL: which -loadView delegates to to do the actual loading. The default implementation remains unchanged, but it's possible to do some asynchronous work here in a subclass.

    opened by d11wtq 5
  • UIActivityViewController support for iOS6+

    UIActivityViewController support for iOS6+

    By setting the new boolean useActivityViewController to YES, SVWebViewController will now present a UIActivityViewController instead of a UIActionSheet. SVWebViewController also now has an applicationActivities property where the programmer can pass in an array of custom UIActivities to display alongside the included ones.

    For this implementation, I have included git submodules TUSafariActivity and ARChromeActivity for SVWebViewControllerAvailableActionsOpenInSafari and SVWebViewControllerAvailableActionsOpenInChrome because UIActivityViewController does not come with these activities. However, this means any person who clones your repo has to now do the extra step of updating the modules, so if you were aiming to be the easiest WebViewController to add to a product you may want to remove references to these.

    opened by rileytestut 4
  • non-obtrusive navbar

    non-obtrusive navbar

    when presented as modal view controller on iPhone the navbar disappears when you scroll down. Also, there's no bouncing when trying to scroll over the top.

    Can be deactivated via webViewController.obtrusiveNavBar = YES;

    opened by HBehrens 4
  • share button crashes on iOS8

    share button crashes on iOS8

    Using the modal web view controller in an iPad page sheet, clicking the share button gives:

    Terminating app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController (<_UIAlertControllerActionSheetRegularPresentationController: 0x7fb38c8e7fe0>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.'
    opened by ebgraham 3
  • Please add semantic version tags.

    Please add semantic version tags.

    I’ve recently added SVWebViewController to the CocoaPods package manager repo.

    CocoaPods is a tool for managing dependencies for OSX and iOS Xcode projects and provides a central repository for iOS/OSX libraries. This makes adding libraries to a project and updating them extremely easy and it will help users to resolve dependencies of the libraries they use.

    However, SVWebViewController doesn't have version tags. I’ve added the current HEAD as version 0.0.1, but a version tag will make dependency resolution much easier.

    Semantic version tags (instead of plain commit hashes/revisions) allow for resolution of cross-dependencies.

    opened by lexrus 3
  • Memory leaks(GeneralBlock)

    Memory leaks(GeneralBlock)

    I have leaks in sample app when controller appear/disappear many times. GeneralBlock-... http://www.flickr.com/photos/62807440@N04/5760975321/in/photostream

    opened by uranpro 3
  • UIWebView Loading Error

    UIWebView Loading Error

    Dears, I faced a silly bug when I load this url inside uiwebview , the url load the request successfully at the first then the uiwebview covered with white view except the title of page . Although I tried to load the same page from Safari and chrome and it loaded successfully without any problems. Url is https://www.filgoal.com/home/views?name=comments&type=article&id=287239

    Thank you in advance Nada Gamal

    opened by nadagamal 0
  • How to get the current URL that is loaded inside the modal?

    How to get the current URL that is loaded inside the modal?

    I'm using the modal to load a site. This site has a few steps at a few different URLs. Once the user reaches a specific URL, I plan on closing the modal.

    How can I achieve this?

    opened by zilions 0
Owner
Transit
Transit
Sample project for select specific Web Browser on iOS.

Sample project for select specific Web Browser on iOS.

Toru Kageyama 0 Oct 24, 2021
PTPopupWebView is a simple and useful WebView for iOS, which can be popup and has many of the customized item.

PTPopupWebView PTPopupWebView is a simple and useful WebView for iOS, which can be popup and has many of the customized item. Requirement iOS 8.0 Inst

Takeshi Watanabe 117 Dec 3, 2022
A drop-in inline browser for your iOS app.

SVWebViewController SVWebViewController is a simple inline browser for your iOS 7 app. SVWebViewController features: iPhone and iPad distinct UIs full

Transit 2.6k Dec 14, 2022
Transition from any SwiftUI Text view into an inline navigation bar title when the view is scrolled off-screen, as seen in Apple's TV & TestFlight iOS apps.

SwiftUI Matched Inline Title Transition from any SwiftUI Text view into an inline navigation bar title when the view is scrolled off-screen, as seen i

Seb Jachec 19 Oct 9, 2022
Subclass of UITextField that shows inline suggestions while typing.

AutocompleteField Subclass of UITextField that shows inline suggestions while typing. Plug and play replacement for UITextField. Delimiter support. Pe

Filip Stefansson 663 Dec 6, 2022
Swift-picker-views - inline single and multi picker views for UIKit. Without tableview! Easy and simple

swift-picker-views Inline single and multiple picker views for UIKit. No tablevi

IBRAHIM YILMAZ 2 Jan 31, 2022
Erik is an headless browser based on WebKit. An headless browser allow to run functional tests, to access and manipulate webpages using javascript.

Erik Erik is a headless browser based on WebKit and HTML parser Kanna. An headless browser allow to run functional tests, to access and manipulate web

Eric Marchand 544 Dec 30, 2022
Erik is an headless browser based on WebKit. An headless browser allow to run functional tests, to access and manipulate webpages using javascript.

Erik Erik is a headless browser based on WebKit and HTML parser Kanna. An headless browser allow to run functional tests, to access and manipulate web

Eric Marchand 544 Dec 30, 2022
FYPhoto is a photo/video picker and image browser library for iOS written in pure Swift. It is feature-rich and highly customizable to match your App's requirements.

FYPhoto is a photo/video picker and image browser library for iOS written in pure Swift. It is feature-rich and highly customizable to match your App's requirements.

null 10 Dec 11, 2022
A small Swift tool/server to serve DocC archives to your browser

servedocc Small Swift script to serve "DocC" archives, a format to document Swift frameworks and packages: Documenting a Swift Framework or Package. N

DocZ 8 Jan 29, 2022
A Powerful Private Browser Developed to Truly Protect your Data

SnowHaze SnowHaze is the first and only iOS browser that truly protects your data! Designed for best possible privacy and security and made to be easi

SnowHaze 115 Nov 6, 2022
A Simple way help you drop or drag your source (like UIImage) between different App.

A Simple way help you drop or drag your source (like UIImage) between different App.

逸风 13 Nov 24, 2022
FlutterNativeDragAndDrop - A package that allows you to add native drag and drop support into your flutter app

native_drag_n_drop A package that allows you to add native drag and drop support

Alex Rabin 21 Dec 21, 2022
Drop in user input validation for your iOS apps.

Validator Validator is a user input validation library written in Swift. It's comprehensive, designed for extension, and leaves the UI up to you. Here

Adam Waite 1.4k Dec 29, 2022
Drag and drop between your apps in split view mode on iOS 9

SplitViewDragAndDrop Easily add drag and drop to pass data between your apps Setup Add pod 'SplitViewDragAndDrop' to your Podfile or copy the "SplitVi

Mario Iannotta 324 Nov 22, 2022
PRGTipView is a drop-in solution for adding onboarding tips to your apps

PRGTipView PRGTipView is a drop-in solution for adding onboarding tips to your apps. It supports: Title, detail and dismissal button Give focus on a p

Iannis Spiropoulos 25 Aug 12, 2022
FlightTicketBrowser - A SwiftUI sample app for flight ticket browser

FlightTicketBrowser This app is a SwiftUI sample app for flight ticket browser.

Takuya Aso 6 Nov 14, 2022
SwiftWebKit - This app look like a browser, but you can navigate between 2 sites

import UIKit import WebKit My first app for WebKit. This app look like a browser

Ahmet Onur Şahin 3 Apr 18, 2022
Browser-ext - Safari Extension Container App

browser-ext See article on dev.to. Please refer to Safari Web Extensions on how

Bing Qiao 4 Jul 18, 2022