Note from Ray: This is an abbreviated version of a chapter from iOS 8 by Tutorials released as part of the iOS 8 Feast to give you a sneak peek of whatís inside the book. We hope you enjoy!
iOS 8 introduces a new concept called App Extensions: a way for you to share your appís functionality with other apps, with to the OS itself.
One of these types of extensions are Today Extensions, also known as Widgets. These allow you to present information in the Notification Center, which can be a great way to provide immediate and up-to-date information that the user is interested in.
In this tutorial, youíll write a Today Extension that renders the current market price of a Bitcoin based on the United States Dollar.
Never has it been so easy to deliver valuable information so quickly to your users. Letís get started!
If youíre not familiar with Bitcoin, the short explanation is that itís a digital cryptocurrency thatís still in its infancy. Aside from using it for peer-to-peer exchanges and purchases, Bitcoin trading allows the user to exchange it for a number of other cryptocurrencies like Dogecoin and Litecoin, and flat currency such as the US Dollar and the Euro.
As a relatively new currency, its market value fluctuates by the minute; there have been huge peaks and troughs in its short lifetime. Thus, itís a perfect candidate for a Today Extension since investors will want up-to-the-second price quotes!
Since youíre writing an extension, youíll first need a host app to extend; meet Crypticker.
Crypticker is a simple app that displays the current Bitcoin price, the difference between yesterdays price and the current price, as well as a price history chart. The chart includes 30 days of history; sliding your finger on the chart reveals the exact price for a specific day in the past.
The extension will contain all of these features, except for touching the chart to see the price for a specific day. There are some limitations within Today Extensions, especially when it comes to swiping. The swipe gesture often triggers swiping between the Today and Notifications sections within Notification Center, so it doesnít really provide the best or most reliable user experience.
**Hidden Content: Reply to see the content**