Skip to Content
Swift学习手册
book

Swift学习手册

by Jon Manning, Paris Buttfield-Addison, Tim Nugent
February 2017
Beginner to intermediate
472 pages
9h 53m
Chinese
China Electric Power Press Ltd.
Content preview from Swift学习手册
374
15
15-2
编辑菜单
新增了
Speak
命令
15.2
SFSafariViewController
中打开链接
目前,文本中的链接可以单击,但是这个功能还不完善,原因有二:
文本视图不在编辑模式中链接才能单击。
轻点链接后会启动
Safari
,把用户带离了应用。用户不一定想这样。
为了解决第一个问题,我们将为
DocumentViewController
添加从“编辑”模式转到
“查看”模式的功能。为了解决第二个问题,我们将覆盖打开链接的当前行为,在
SFSafariViewController
中打开链
接。
在应用中显示
Web
内容的方式有三种:使用
WKWebView
UIWebView
己创
建微型浏览器;使用
openURL
方法打开
Safari
,把用户带到应用之外;使用
SFSafariViewController,在应用中显示一个简化版
Safari
本书不会讨论
WKWebView
UIWebView
,这是以前处理复杂的
Web
视图或者为
iOS
开发
Web
浏览器(如
Chrome
Firefox
Mercury Browser
等)时使用的。过去,多数应用使
UIWebView
自行实现微型浏览器,或者使用较新的
WKWebView
Web
内容。这么做
有很多缺点,其中最为主要的是各个应用内的微型浏览器都有自己的
UI
,而且不能访问
iCloud Keychain
,此外还缺少一些其他
Safari
功能。
这里,我们将使用
SFSafariViewController
,因为它是在应用中显示 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

PyTorch深度学习

PyTorch深度学习

Posts & Telecom Press, Vishnu Subramanian
深入淺出代數

深入淺出代數

Tracey Pilone, Dan Pilone
PHP学习手册

PHP学习手册

David Sklar
C语言核心技术(原书第2版)

C语言核心技术(原书第2版)

Peter Prinz, Tony Crawford

Publisher Resources

ISBN: 9787519803223