• Awards Season
  • Big Stories
  • Pop Culture
  • Video Games
  • Celebrities

Exploring Safari’s Online Features: What You Need to Know

Safari is a popular web browser developed by Apple Inc. Known for its sleek design and seamless user experience, Safari has grown to become one of the most widely used browsers across various devices. In this article, we will delve into Safari’s online features and help you discover how you can make the most of your browsing experience.

Enhanced Privacy and Security

When it comes to online browsing, privacy and security are paramount concerns for many users. Safari takes these concerns seriously and offers several features to ensure a safe and secure browsing experience.

One notable feature is Intelligent Tracking Prevention (ITP), which helps protect your privacy by preventing websites from tracking your online activities across different sites. This feature limits the use of cookies and other website data, making it harder for advertisers to track your behavior.

Safari also utilizes sandboxing technology, which isolates each website in its own separate process, preventing malicious code from affecting other parts of your system or compromising your personal information.

Additionally, Safari includes built-in protection against fraudulent websites and phishing attempts. It automatically checks URLs against a list of known malicious websites, keeping you safe from potential threats.

Seamless Integration with Apple Ecosystem

If you are an Apple user with multiple devices such as iPhones, iPads, or Macs, Safari offers seamless integration across all these devices. With iCloud syncing enabled, you can easily access tabs open on one device from another device using Safari’s “Shared Tabs” feature.

This means that if you find an interesting webpage on your iPhone but prefer to read it on your iPad or Mac later on, simply open up Safari on the other device and select the “Tabs” button in the toolbar. You will find a list of all open tabs across all synced devices, allowing you to continue where you left off seamlessly.

Furthermore, when it comes to passwords and credit card information, Safari offers its own password manager called iCloud Keychain. It securely stores your passwords and credit card details across all your Apple devices, making it convenient to autofill login forms and make online purchases with ease.

Intelligent Tab Management

With the increasing number of tabs we open while browsing the internet, managing them efficiently becomes crucial for productivity. Safari provides several features to help you organize and navigate through your tabs effortlessly.

One such feature is the ability to group tabs together. You can create tab groups based on specific themes or topics by simply dragging one tab onto another. This helps keep your browsing organized and makes it easier to find related content when you need it.

Safari also offers a powerful tab search feature that allows you to quickly locate a specific tab by typing in keywords or even searching for open tabs from a particular time range. This eliminates the hassle of scrolling through numerous tabs to find what you are looking for.

Moreover, Safari’s “Tab Preview” feature provides a visual overview of all open tabs, making it easier to identify and switch between them with just a glance.

Customization Options

Personalization is key when it comes to enhancing your browsing experience, and Safari understands this well. The browser offers various customization options that allow you to tailor Safari according to your preferences.

Safari’s “Extensions” feature enables you to enhance the functionality of the browser by installing third-party extensions from the App Store. These extensions can add features such as ad-blocking, password management tools, or even productivity-enhancing tools like note-taking apps.

In addition, Safari allows you to modify its appearance by choosing from different themes or customizing toolbar buttons according to your liking. You can also adjust settings related to privacy, security, and content restrictions based on your individual needs.

By taking advantage of these customization options, you can truly make Safari feel like your own personalized browsing tool.

In conclusion, Safari’s online features offer a range of benefits to users. From enhanced privacy and security measures to seamless integration with the Apple ecosystem, intelligent tab management, and customization options, Safari has a lot to offer. So, if you’re looking for a reliable and feature-rich web browser, give Safari a try and explore the vast possibilities it offers for your online browsing needs.

This text was generated using a large language model, and select text has been reviewed and moderated for purposes such as readability.

MORE FROM ASK.COM

safari view controller vs webview

View in English

Should I use WKWebView or SFSafariViewController for web views in my app?

October 8, 2020

Safari icon

Whether your app needs to provide a full web browsing experience, display richly-styled content, or incorporate external websites without taking people out of your app, you can make the experience smooth and seamless by choosing the right API.

You can display web content inside of your app with both the WKWebView and SFSafariViewController APIs. But which is the best for your app’s needs?

WKWebView is part of the WebKit framework: It allows you to embed web content into your app as a seamless part of your app’s UI. You can present a full or partial view of web content directly in your app by loading a view that leverages existing HTML, CSS, and JavaScript content or create your own if your layout and styling requirements are better satisfied by using web technologies.

Note: If your app uses the deprecated UIWebView API to display web content, you should update your code for improved security, performance, and reliability. Learn more:

safari view controller vs webview

Deadline extended for app updates using UIWebView

Apple designed WKWebView in 2014 to ensure that you can integrate web content into your app quickly, securely, and consistently across iOS and macOS. Since then, we’ve recommended that you adopt WKWebView instead of UIWebView and WebView — both of which were formally deprecated. New apps...

SFSafariViewController is part of the SafariServices framework, and lets your users browse a web page, or a website right inside your app. With it, people can enjoy the same web browsing experience they get in Safari — including features like Password Autofill, Reader, and Secure Browsing — without ever having to leave your app.

These two APIs can provide a lot of the heavy lifting for web technologies in your app, though there are a few instances where we recommend alternative frameworks. For example, when presenting a web-based login screen for your app, use ASWebAuthenticationSession to provide people with the most secure experience.

When should I use WKWebView?

If you need to customize or control the display of web content — or interact with the content itself — WKWebView will be most flexible in helping you build the implementation that suits your needs. (If your app is designed to be used offline, make sure any WKWebView content has appropriate fallbacks and alerts.)

Additionally, consider WKWebView if you need to display HTML or CSS content inline or as part of rest of your app’s user interface.

The Washington Post’s development team implemented WKWebView to display content from the Washington Post website within their app.

The Washington Post’s development team implemented WKWebView to display content from the Washington Post website within their app.

In short, WKWebView is an incredibly powerful technology that works in tandem with iOS and macOS frameworks. That said, WKWebView is not designed to outright replace system technologies and frameworks. For example, you should avoid using it in place of device-optimized UIKit classes like UITableView, UIImage, and UIButton, as you lose out on core system behaviors and provide a subpar experience for people who use your app.

When should I use SFSafariViewController?

When you want display websites inside your app without sending people to Safari, the best tool is SFSafariViewController. By using this API, you can effectively embed the Safari interface — and many of its key features and privacy protections — into your app.

The Apple Developer app displays web links through SFSafariViewController.

The Apple Developer app displays web links through SFSafariViewController.

SFSafariViewController is best used when you need to display interactive web experiences on websites you don’t own, or showcase parts of your web content that are generally outside the scope of your app.

SFSafariViewController

Open Links in Safari, Not Safari View Controller

safari view controller vs webview

Earlier this year in PSPDFKit 8.5 for iOS and PDF Viewer 3.6 for iOS , we changed the default setting for opening web links in PDFs from opening an in-app browser to opening Safari. In-app browsers are commonly used in third-party iOS apps, so this change might seem like it’s going against the grain. But in this post, I’ll discuss why we made this change and why this was the right time to do so.

Some Background

Years ago, iOS app makers found that after opening a web link in Safari, it was hard for the user to get back to their app. This could leave the user feeling frustrated, and it could also be a disadvantage for the app maker if engagement was a key metric. The solution to this was to create an in-app web browser so that the user never left the app and could get back to where they were with just a tap.

Initially, these in-app browsers used the UIWebView API to load and render the web content. In iOS 8, Apple created the WKWebView API to improve performance, security, and reliability by moving the web content management to a separate process managed by the system. This tended to be a better option for in-app web views. PSPDFKit supported both of these in its in-app web view, PSPDFWebViewController . We finally removed support for UIWebView in PSPDFKit 9 for iOS, which was good timing, because Apple has started sending warnings when apps referencing UIWebView are uploaded to App Store Connect.

Presumably after seeing the inconsistent user experience due to each third-party app designing and implementing its own in-app browser, Apple added the SFSafariViewController API in iOS 9. This system-provided view goes beyond WKWebView by providing a full user interface for an in-app browser. However, despite this apparent endorsement, Apple never used SFSafariViewController in its own apps as an in-app browser. In fact, the Apple recommendation in the iOS Human Interface Guidelines is very clear:

Avoid using a web view to build a web browser. Using a web view to let people briefly access a website without leaving the context of your app is fine, but Safari is the primary way people browse the web on iOS. Attempting to replicate the functionality of Safari in your app is unnecessary and discouraged.

There isn’t a lot of explanation there as to the why, so let’s think of some reasons Apple may be recommending this.

It’s Easy to Go Back on Modern iOS

iPhone X and later and all iPads on iOS 12 now have fluid multitasking gestures, which means a swipe along the bottom of the screen will take you back to the app you were in before tapping on a link. For older devices and OS versions, there is still the back button shown on the far-left side of the status bar after opening a link.

Getting the Full Safari Experience

SFSafariViewController provides the core web browsing functionality from Safari but misses many of the details of the full app. Originally, SFSafariViewController shared cookies with the main app, but this changed in iOS 11. This means if a user opens a website that requires signing in, they will have to do this from scratch even if they have already signed in using the Safari app. Or, more likely, they’ll tap the button in SFSafariViewController to switch over to Safari, which is what your app was trying to avoid in the first place.

Other benefits of the full Safari app are iCloud tabs and Handoff.

Much More Flexibility

SFSafariViewController presents web content modally over the app displaying it, so it covers up the app. This means if the user wants to switch back and forth between the app and a webpage, they have to keep reopening the webpage. By opening links in Safari instead, the user can keep both the app and the webpage open and switch between them without any loss of state. The app and Safari could even be side by side in Split View on iPad. Additionally, with the latest OS, Safari supports opening multiple windows. There are so many possibilities.

What’s more is Safari supports state restoration, so the user can leave the webpage open in Safari for a long time. Even if they come back another day, it will still be there.

Meanwhile, with SFSafariViewController , the app ends up looking like Safari, which makes it harder to distinguish from Safari in the app switcher at a glance.

Links Don’t Necessarily End Up in Safari

I’ve been referring to opening links in Safari, but this isn’t the complete picture. What the app actually does is simply tell the system to open the link. Usually this results in opening Safari, but not always.

For example, if a native app can handle the link as a universal link , it will automatically open the app instead. There is a workaround for this with SFSafariViewController , where you can preflight universal links , but by letting the system handle the entire link-opening procedure, everything is taken care of for you.

Additionally, when PSPDFKit or PDF Viewer run on the Mac using Mac Catalyst, links will open in the users’ preferred default browser, which is not necessarily Safari, and our code doesn’t need to know anything about which browser ends up being opened. On the subject of the Mac, a modal in-app browser would feel very out of place there, and in fact, trying to show an SFSafariViewController will open the default browser instead.

Which Should You Choose?

In this post, we looked at the many advantages of opening links in Safari instead of using an in-app browser. The main disadvantage of opening links in Safari is the user has to manually close pages in Safari, so in the case where the user just wants to look at a webpage once and then is finished with it, they have to take an additional action to discard the page. iOS 13 has something of a solution to this with the option to automatically close tabs in Safari after a certain amount of time.

We’re not forcing opening links in Safari on our customers or users. PSPDFKit provides APIs to open SFSafariViewController or PSPDFWebViewController (using WKWebView ), and in PDF Viewer, links can be set from the advanced settings screen to open using SFSafariViewController . Additionally, if the PDF specifies that a link should be opened in a certain way, we’ll respect that. However, we think opening links in Safari is the best user experience because it gives the user the full Safari feature set and more multitasking flexibility, so we chose this as our default.

Related Products

Pspdfkit for ios.

Product Page Guides API Docs Example Projects

safari view controller vs webview

Related Articles

safari view controller vs webview

Case Study: How Trinoor Uses PSPDFKit to Drive Operational Excellence with Flexible, Mobile Applications for the Energy and Utilities Market

safari view controller vs webview

PSPDFKit 13 for iOS 17

safari view controller vs webview

How to Edit PDFs in an iOS Application Using a PDF Library

22. Displaying Web Content with WKWebView and SFSafariViewController

Chapter 22 displaying web content with wkwebview and sfsafariviewcontroller.

safari view controller vs webview

I've got a theory that if you give 100% all of the time, somehow things will work out in the end. - Larry Bird

It is very common you need to display web content in your apps. The iOS SKD provides three options for developers to show web content:

  • Mobile Safari - the iOS SDK provides APIs for you to open a specific URL in the built-in Mobile Safari browser. In this case, your users temporarily leave the application and switch to Safari.
  • WKWebView - This view allows developers to embed web content in your app. You can think of WKWebView as a stripped-down version of Safari. It is responsible to load a URL request and display the web content. WKWebView has the benefit of the Nitro JavaScript engine and offers more features. If you just need to display a specific web page, WKWebView is the best option for this scenario.
  • SFSafariViewController - this is a new controller introduced in iOS 9. While WKWebView allows you to embed web content in your apps, you have to build a custom web view to offer a complete web browsing experience. For example, WKWebView doesn't come with the Back/Forward button that lets users navigate back and forth the browsing history. In order to provide the feature, you have to develop a custom web browser using WKWebView . In iOS 9, Apple introduced SFSafariViewController to save developers from creating our own web browser. By using SFSafariViewController , your users can enjoy all the features of Mobile Safari without leaving your apps.

Figure 22-1. The About screen of the FoodPin app

In this chapter, I will walk you through all the options and show you how to use them to display web content. For both WKWebView and SFSafariViewController , we will need to make use of UIViewRepresentable and UIViewControllerRepresentable to integrate with these components because they are only available in UIKit.

To demonstrate how to show web content in SwiftUI, we will build the About tab to display three options:

  • Rate us on App Store - when selected, we will load a specific iTunes link in Mobile Safari. Users will leave the current app and switch to the App Store.
  • Tell us your feedback - when selected, we will load a Contact Us web page using WKWebView.
  • Twitter / Facebook / Instagram - Each of these items has its own link for the corresponding social profile. We will use SFSafariViewController to load these links.

Sounds interesting, right? Let's get started.

To access the full version of the book, please get the full copy here . You will also be able to access the full source code of the project.

results matching " "

No results matching " ".

safari view controller vs webview

iOS DEVELOPER

WRITER. SPEAKER.

21 Mar, 2023 • 3 minute read

Display in-app web content with SFSafariViewController in SwiftUI

You can use Link to let users open a website in their web browser, outside of your app. But sometimes you want to present web content and don't want the users to leave your app.

To implement this feature, we have two available APIs: WKWebView and SFSafariViewController . Which one you choose, depends on the experience you want to provide.

WKWebView is part of the WebKit framework. It allows you to embed web content into your app. You can embed entire views or parts of your UI. Use it when you need to incorporate web content into your app alongside your app's native views. It's flexible and highly customizable. If you have to assign a custom user agent, then this API is for you.

SFSafariViewController is part of the SafariServices framework. It allows you to present a website from within your app. Users will never leave your app and they get the same experience as if they were using Safari, including password auto-fill and all security Safari provides. Use it when you need to display websites you don't own or present parts of web content that's out of scope of your app.

Always make sure the view controller is visibly present and never track users without their consent or you'll be in violation with the App Store Review Guidelines .

In this article, you'll learn how to use the latter.

Wrap the View Controller

SFSafariViewController , as the name suggests, is a UIKit component. To use it in your SwiftUI app, you need to create a view that represents a UIKit view controller by implementing the UIViewControllerRepresentable protocol.

First, import SwiftUI and SafariServices frameworks. Create the SafariViewWrapper and conform to the UIViewControllerRepresentable protocol. Implement the required methods:

Since you're only presenting a website, in the makeUIViewController(context:) method you return the SFSafariViewController(url:) and pass the url as an argument.

updateUIViewController(_ :context:) is required for protocol conformance, but we don't need to do any updates so we can leave it empty. You're only presenting a website, in this case.

You can call the SafariViewWrapper directly, but I like to create a reusable View component because it's likely I'll need to use it multiple times.

Create a SafariView with showSafari state property and pass in the title and url :

You create a Button with a title that updates the presentation state of the popover when the user taps on it. You can also present the website as a full screen cover, but in this example, I'm using a modal popover.

Finally, you can implement it in any View:

Add the @State private var showSafari = false at the beginning of your view to pass in the state to the child view to present the popover. Give the link an appropriate title and a url.

When you tap the link, you'll see the website inside your app.

In-app website popover presented using the SFSafariViewController

Final Thoughts

At the time of writing, there's no SwiftUI way of presenting an in-app web view so we have to resort to using UIKit APIs. But using them interchangeably is not a big task. They pair nicely with each other.

You can wrap any UIKit controller into a SwiftUI view and vice versa.

If you're interested in learning more how you can use both SwiftUI and UIKit to build responsive UIs, this talk from Adam Bell at iOS Conf SG 2023 is a good watch: Building Responsive Interactions .

Please feel free to reach out on Twitter if you have any questions, comments, or feedback.

Thank you for reading and happy coding!

IMAGES

  1. Should I use WKWebView or SFSafariViewController for web views in my

    safari view controller vs webview

  2. iOS 9 and Safari View Controller: The Future of Web Views

    safari view controller vs webview

  3. Xamarin.iOS の Web ビュー

    safari view controller vs webview

  4. How the 6s Plus Is Reshaping My iPhone Experience

    safari view controller vs webview

  5. HOW TO OPEN LINKS IN SAFARI || USING SAFARI WEB VIEW IN SWIFT 3

    safari view controller vs webview

  6. #sfsafariviewcontroller resources from the Figma Community

    safari view controller vs webview

VIDEO

  1. Etawah Lion safari view with #aru& mihir #

  2. Controller vs bush

  3. Controller VS Mobile

  4. Jungle view forestry #vlog video #villagefood #villagelifestyle

  5. dessert safari view #youtubeshorts

  6. New safari vs of safari #safari

COMMENTS

  1. Safari vs. Other Web Browsers: Which One Should You Download?

    In today’s digital age, choosing the right web browser can greatly impact your online experience. With a plethora of options available, it can be overwhelming to decide which one to download. One popular choice among users is Safari, Apple’...

  2. Exploring Safari’s Online Features: What You Need to Know

    Safari is a popular web browser developed by Apple Inc. Known for its sleek design and seamless user experience, Safari has grown to become one of the most widely used browsers across various devices.

  3. The 5 Best Luxury African Safari Tours

    Every year, more than 30 million tourists visit Africa, with many of them choosing to go on safaris. A safari is a chance to experience Africa outside of the cities and resorts, and it often leads to opportunities to see wildlife in its nat...

  4. Should I use WKWebView or SFSafariViewController for web views

    Note: If your app uses the deprecated UIWebView API to display web ... When you want display websites inside your app without sending people to

  5. iOS

    The view controller includes Safari features such as Reader, AutoFill

  6. When can I use a SFSafariViewController, WKWebView, or

    If you instantiate a SFSafariViewController, WKWebView, or UIWebView object to handle a universal link, iOS opens your website in Safari instead

  7. SFSafariViewController

    SFSafariViewController is a view controller for displaying web content in a Safari-like interface with some of Safari's features.

  8. A Simple Guide to Safari View Controller and More (SwiftUI)

    The story began with the Safari web browser back in 2003. The corresponding WebView class is made available to developers later that year.

  9. Изменения WebKit и Safari в iOS 11

    Apple также внесла изменения в конфиденциальность в safari View Controller в iOS 11. ... webView, IWKUrlSchemeTask urlSchemeTask){ // Implement a

  10. Safari View Controller

    Web View. Apple известна своей приверженностью к обеспечению ... Ответ прост: им невыгодно, чтобы пользователи делились контентом или сохраняли

  11. Open Links in Safari, Not Safari View Controller

    PSPDFKit supported both of these in its in-app web view, PSPDFWebViewController . We finally removed support for UIWebView in PSPDFKit 9 for iOS, which was good

  12. iOS WebViews

    This will open a new Safari Web Inspector window for inspecting the

  13. 22. Displaying Web Content with WKWebView and ...

    It is very common you need to display web content in your apps. The iOS SKD provides three options for developers to show web content: Mobile Safari - the

  14. Display in-app web content with SFSafariViewController in SwiftUI

    Wrap the View Controller. SFSafariViewController , as the name suggests, is a UIKit component. To use it in your SwiftUI app, you need to create