As a developer you quickly find out that many of the more useful apps require a web backend of some sort. This presents a problem for developers looking to build something without wanting to create a website and a RESTful API service to support their app. There are a number of platforms that seek to solve this problem, but the one I’ve been playing with lately is Parse. Parse so far has impressed me for a number of reasons, but mainly because it’s free for quite a few requests and really easy to use. This tutorial will walk you through getting started with parse and demonstrate some of the nifty features.
iOS Programming Recipe 16.2: Populating A UITableView With Data From The Web – iOS 7 and AFNetworking 2.0
This article will be nearly the same as Recipe 16, except that it will cover AFNetworking 2.0 and iOS 7 instead.
- You have a grasp on Xcode basics. If not go get some education here.
- I also recommend reading the other two tutorials on creating table view as I’ll be building on some of the concepts in those tutorials: Recipe 11 Part 1 & Recipe 11 Part 2
Sometimes it can be handy to either translate an address into a set of coordinates, or get an address from a set of coordinates. These processes are known as geocoding and reverse geocoding respectively. This quick tutorial will go over how to do these things using location services.
This week we’re gonna check out some of the mapping functionality available in iOS 7. If you haven’t heard by now, developers now have nearly full access to 3D mapping API’s. Now, you can show you’re own 3D maps.
One of the coolest things about the iPhone is it’s ability to handle audio. Since it was born out of an iPod, the iPhone handles audio quite well. In this recipe we’ll explore audio recording and playback. We’ll be creating a simple app that records a sound file and plays it back. We’re basically making a voice memo app that only saves one memo and plays it back.
This week I thought I would have a bit of fun and explore image manipulation using Core Image. This sounds like it could be pretty tough, but Apple has actually made this very easy. In this Recipe we’ll be creating a photo filter app that will let you choose a photo or take a photo using the camera and filter it.
- You know the basics of Xcode, If not, we got you covered: Familiarizing Yourself With Xcode
- You know how to create outlets and actions using the interace builder
- You have a developer account and can run this app on hardware, This will be necessary if you want to capture an image using the camera
Setting Up the Project
Setting Up the Framework
Go ahead and start with a single view controller application using storyboards and title it “ImageFilterApp”.
For this App we’ll need to use the Core Image framework. To add a framework select the top level project from the project navigator on the left and scroll down in the main window to “Linked Frameworks and Libraries”. Here you can press the “+” button to add the new framework. When the dialogue opens choose the “CoreImage.framework” and press the “Add” button.
One of the coolest things smartphones are capable of now is the ability to sense motion and orientation. The iPhone does this with the use of a 3-axis Accelerometers and Gyroscopes. In this tutorial we’re going to create an app that indicates the current G and speed of rotation. Not exactly a pretty app but still instructional.
- You have a developer account and have provisioned a device. Unfortunately we can’t simulate this stuff without hardware. Follow the Apple documentation here to get set up.
- Make Sure you head over our Github page and download the source code. NSCookbook Github Recipe 19
- You have looked over some of the past tutorials and are comfortable with creating outlets and actions from the interface builder
Setting Up the Interface
Our Interface will be pretty simple as we will be displaying 12 values. We’ll show Max and Current Acceleration and Rotation about the X,Y and Z axis’.
Start with a new single view project titled “GyrosAndAccelerometers” and make sure the storyboards are selected.
Once the new project is created, open up the storyboard and drag 25 Labels onto the view. Twelve of these labels will be our outlets that will display the output data for each axis. Rename the labels and add a button as shown in the image below:
Since UITableView is so prominent in iOS apps, I felt it would be a good idea do one more useful recipe on the subject. For this Recipe we’ll be creating a UITableview complete with a detail view and a navigation controller. In addition, we’ll populate the table and the subsequent detail view with information retrieved from a web service. For this tutorial, we’ll be using the google places API to retrieve a list of restuarants in a city, display them in a tableview, and show more restaurant details in a detail view.
- You have a grasp on Xcode Basics. If not, go get some education here.
- I also recommend reading the other two tutorials on creating table Views as I’ll be building on some of the concepts in those tutorials.
Designing The Interface
To start off, we’re going to create a project using the Single View Application Template. Title the project “WebTableView”. On the storyboard, drag a new navigation controller into the scene. Control click from the prototype cell of the table view controller to the view controller and choose push from the segue type.
UICollectionView is great for displaying information in a grid or other custom layouts. In iOS 6 you’ll see collection views most likely used in many apps such as the podcasts app for viewing different podcasts. Since in most cases you’ll want to use UICollectionViewController, we’ll focus on that for this recipe.
- You are familiar with Xcode and setting up a single view controller. If not check out our recipe on Xcode first.
Setting Up The View
Go ahead and create a new single view controller project. I titled mine “CollectioViewFun”. When the project opens up, You’ll want to delete the single view controller from the storyboard and drag a new collection view controller in it’s place. This should look like the following:
Now since our class type has changed from a standard view controller to a collection view controller we’ll want to change the class type in the viewController.h file as well. Go ahead and change the class name from ViewController to CollectionViewController as well. Don’t forget to change all instances of the term “ViewController” in both the .m and .h files:
In Part I of this recipe we left off with a UITableView that Displayed some creatures which were grouped by type. In this Recipe we’ll be extending the functionality a bit and emplement a delegate in order to handle a touch event. In addition, we’ll take a minute to explore styling of the table view and cells.
- You Have already read through Part I, if not read through that first.
Styling The Table View
The next two sections will be brief, but I thought it was worth visiting since there are a few things that can be done right from the property inspector.
First of choose the tableview object from the storyboard and go to the property inspector tab on the top right hand pane. Choose Grouped from style section and go ahead and change default to some color, I change mine to blue.