Skip to Content
Programming iOS 10
book

Programming iOS 10

by Matt Neuburg
November 2016
Beginner to intermediate content levelBeginner to intermediate
800 pages
30h 12m
English
O'Reilly Media, Inc.
Content preview from Programming iOS 10

Chapter 11. Web Views

A web view is a web browser: it knows how to fetch resources from the Internet, and it understands and can render text coded in HTML, along with associated instructions coded as CSS and JavaScript. Thus it is a network communication device on the one hand, and a powerful engine for layout, animation, and media display on the other.

All of that power comes “for free” with a web view. It gives your app a browser interface, comparable to Mobile Safari; you can just stand back and let it do its work. You don’t have to know anything about networking. Links and other ancillary resources work automatically. If your web view’s HTML refers to an image, the web view will fetch it and display it. If the user taps on a link, the web view will fetch that content and display it; if the link is to some sort of media (a sound or video file), the web view will allow the user to play it.

A web view also knows how to display various other types of content commonly encountered as Internet resources. For example, a web view is an excellent way to display PDF files. It can also display documents in such formats as .rtf, Microsoft Word (.doc and .docx), and Pages. (A Pages file that is actually a bundle must be compressed to form a single .pages.zip resource.)

Warning

A web view should also be able to display .rtfd files, but in iOS 8 and 9, it can’t. In iOS 10, the file loads if it is zipped (type .rtfd.zip), but embedded images are not displayed, which makes the .rtfd more or ...

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.
Start your free trial

You might also like

Programming iOS 12

Programming iOS 12

Matt Neuburg
Programming iOS 11

Programming iOS 11

Matt Neuburg
Programming iOS 13

Programming iOS 13

Matt Neuburg

Publisher Resources

ISBN: 9781491970157Errata Page