01.02.2014 Views

Objective-C Fundamentals

Objective-C Fundamentals

Objective-C Fundamentals

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The iPhone SDK: Safari<br />

317<br />

C.3.2<br />

have potentially patchy (or no) coverage. Mobile Safari offers support for an HTML5 feature<br />

called the Offline Application Cache that offers a solution to this limitation. It allows<br />

a manifest file to be written that outlines the files (HTML, JavaScript, CSS, and image files)<br />

a web application requires. Safari downloads all files listed in the manifest and ensures<br />

they’re available while offline. Provided your web application doesn’t depend on serverside<br />

functionality, your application will happily run while the device is offline.<br />

The Offline Application Cache is only<br />

one of many advanced technologies<br />

implemented by Safari. Other examples<br />

include extensions to CSS to support<br />

rounded edges, shadows, transforms, animations,<br />

and transitions; rich canvas and<br />

SVG support for vector-based client-side<br />

drawing; and even APIs to store data on<br />

the client side.<br />

Figure C.3 Examples from http://cubiq.org, the<br />

blog of Matteo Spinelli, demonstrating the use of<br />

Mobile Safari is a world-class mobile<br />

CSS3 transitions, animations, transformations,<br />

browser designed to enable the development<br />

of serious web-based applications. approach the behavior and look and feel of native<br />

JavaScript, and HTML to build web-based UIs that<br />

iPhone applications<br />

As evidence of some of the powerful UI<br />

elements that can be crafted with pure<br />

HTML, CSS, and JavaScript, take a look at the various demos available on Matteo<br />

Spinelli’s blog at http:// c u b i q . o rAs g . seen in figure C.3, many of the UI elements<br />

seen in Apple and third-party iOS applications can be replicated easily in a webbased<br />

environment.<br />

An intrinsic advantage of developing using standardized web-based technologies is<br />

their inherent ability to support more than one platform. With tweaks to your HTML<br />

and CSS, it’s often possible to develop a web application that provides fairly good<br />

native look and feel across a wide range of mobile platforms, such as Microsoft’s Windows<br />

Mobile (now called Windows Phone), Research In Motion’s Blackberry, Palm’s<br />

WebOS, and Nokia’s various platforms. With Mobile Safari leading the charge, most if<br />

not all of these alternative platforms have equally rich web browser support. This isn’t<br />

to say you’re left with a mediocre application that can’t access device-specific functionality.<br />

An iPhone web application has access to a number of iPhone-specific device<br />

capabilities and features.<br />

iPhone OS integration<br />

iPhone integration for web applications covers not only access to hardware features<br />

such as the GPS, accelerometer, and compass, but also aspects that help make web<br />

applications feel more like a natural part of the operating system. For example, by<br />

adding the following line of HTML to your main page, you can enable a static image to<br />

be displayed as a splash screen while your web application HTML and JavaScript<br />

source code is downloaded, parsed, and rendered behind the splash screen: .

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!