---
title: "Web bites - Little Bites of Cocoa"
description: "Little Bites of Cocoa about Web: short tips and techniques for iOS and Mac development, each a brief explanation of one concept, technique or tool."
url: "https://littlebitesofcocoa.com/topics/43-web"
author: "Jake Marsh"
---
# Bites about: [Web](https://littlebitesofcocoa.com/topics/43-web)

Topics

- [Web](https://littlebitesofcocoa.com/topics/43-web)
- [iOS 9](https://littlebitesofcocoa.com/topics/2-ios-9)

## [#18: SFSafariViewController 👒🏄](https://littlebitesofcocoa.com/18-sfsafariviewcontroller)

 Wednesday June 17th, 2015

Topics

- [Web](https://littlebitesofcocoa.com/topics/43-web)
- [iOS 9](https://littlebitesofcocoa.com/topics/2-ios-9)

*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)
  }

}
```

![Image from bite #18: SFSafariViewController](https://media.littlebitesofcocoa.com/bite-assets/018-sfsafariviewcontroller-example.png)

## 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

 

 
