We believe that a killer developer product comes with support resources just as good as the product itself. To that end we have built a developer sample application to help you get off to a fast start with UI for iOS. It contains a comprehensive set of examples with source code available for use. In this blog post, I will explain what it covers and where to find it.
The app ships with the UI for iOS suite which you can download from here. After you install the suite, you can find the app at Documents >> Telerik >> UI for iOS folder. Open the TelerikUIExamples project from the TelerikUIExamples folder and voila: you are now one step closer to understanding how to leverage UI for iOS in your projects
Or, you can get the TelerikUIExamples from GitHub that will be updated on regular basis. Please note that in order to use the GitHub application, you should still have the Telerik UI for iOS product installed.
You will learn how you can setup the various chart series types supported by TKChart. Setting up a Scatter series or Stacked 100 Area series will be no riddle for you, finding the right snippets like these:
And here are the rest of the series types available in the application.
Populating TKChart with data
TKChart allows for data populating using three different approaches depending on the scenario and your programming preferences. For example, if you have a business object to populate in TKChart, you might find the following code snippet useful:
Animations, animations, animations
Animations are cooland funky, and when properly used they contribute very much to the delightful user experience. To make sleek animations easily achievable in iOS, we introduced a flexible animations API utilizing Core Animations and UIKit Dynamics animations. Here is how to implement a custom animation for the pie chart:
And here are the rest of the animation that you can achieve using the code snippets provided.
Many apps require highly customizable Chart UI to accommodate diverse scenarios and TKChart offers powerful customization capabilities. In order to get you started easily, the Customize example features a bunch of styling changes in the default TKChart look and feel, so that you can reuse the code with your colors.
Annotations and Trackball
Annotations allow you to make notes of trends or observation anywhere on the plot. TKChart supports a great set of annotations including – band, line, balloon. Here is how you can set a simple balloon annotation:
The rest of the supported annotations covered by the respective examples, hence code snippets, you can find below:
The samples app is a great way to learn the nuances that UI for iOS can bring to your app. And in addition to it, you are backed up by the Product Documentation for UI for iOS.
Nikolay Diyanov Diyanov is the Product Manager of the Native Mobile UI division at Progress. Delivering outstanding solutions that make developers' lives easier is his passion and the biggest reward in his work. In his spare time, Nikolay enjoys travelling around the world, hiking, sun-bathing and kite-surfing.
Find him on Twitter @n_diyanov or on LinkedIn.