---
title: "#18: SFSafariViewController 👒🏄"
url: https://littlebitesofcocoa.com/18-sfsafariviewcontroller
author: Jake Marsh
published: 2015-06-17
topics: ["Web","iOS 9"]
description: "SFSafariViewController is another new addition in iOS 9, and it’s a great one. Get ready to throw out all that custom in-app browser or third-party library..."
---

# #18: SFSafariViewController 👒🏄

By Jake Marsh, June 17, 2015. HTML: https://littlebitesofcocoa.com/18-sfsafariviewcontroller

_SFSafariViewController_ is another new addition in iOS 9, and it’s a great one.

Get ready to throw out all that custom in-app browser or third-party library code you’ve been using.

Unlike other solutions, _SFSafariViewController_ embeds all of the power of Safari on iOS (including Autofill, shared cookies, etc.) directly into your app.

Replacing your existing solutions should be trivial for most people, here’s how:

``` swift
import SafariServices

class BookmarksViewController : UITableViewController {

  func didSelectBookmark(bookmark: Bookmark) {
    let vc = SFSafariViewController(
      URL: bookmark.URL,
      entersReaderIfAvailable: false
    )

    presentViewController(vc, animated: true, completion: nil)
  }

}
```

<img src="https://media.littlebitesofcocoa.com/bite-assets/018-sfsafariviewcontroller-example.png" style="max-width: 223px;" />

## SFSafariViewController Pro Tips

- set a delegate to configure custom activity items in the share sheet
- use the `entersReaderIfAvailable` property to start the user in reader view
