Category: <span>iOS</span>

Having a list of article isn’t enough, we need to allow users to click through to the actual article. It’s also not a good user experience to have each article open in safari. We want to provide the ability to view the article within our app. Apple UIKit makes this extremely easy by providing a Web View component to view the target website. 1. Add New View Controller We want to first add a new View Controller that will hold the Web View. This can be done by dragging View Controller from object browser over to the storyboard. Once added,…

iOS Tutorial

This tutorial, up until now, focused on the non-visual aspect of development, or as I would call it, the plumbing. It’s now time to put the visuals aspects using some of these plumbing we’ve built onto our storyboard. Storyboard is a feature built into Xcode that represents the screens in an app and the transitions between them. It is similar to Interface Builder with the added advantage of defining transitions. If you have done any WinForm development, both storyboard and interface builder concepts will be easy to understand. If you’re coming from Java AWT and/or swing, concepts may be very foreign…

iOS Tutorial

Up to previous entry, we’ve successfully connected to DZone RSS Feed and parsed its XML. Given we’re working with mobile devices that could be disconnected from the internet, we want to persist the parsed RSS XML. This is helpful as it allows our app to display the most recently downloaded content when there’s no internet connectivity. Persisting RSS Content Following prior tutorial, let’s create a group call “Util” and associate it to a specific file system folder “Util”. Then, add a new file called JSTRRSSUtil, a subclass of NSObject, to this group. Let’s expose a convenience method in our header…

iOS Tutorial

In previous tutorial, we learn to make a call to a website and download its content. Since we are dealing with RSS, we need to be able to parse the resulting XML data. Here’s an example article from DZone article at the time of writing this blog. With objective-c foundation library, we can easily parse the above XML by simply implementing the optional methods of NSXMLParserDelegate. We will pick out only the relevant data from each item and store them in dictionary. Each item will then be added to an array to be used in our storyboarding tutorial. NSXMLParserDelegate Like in…

iOS Tutorial

Now that we have our idea and our visual mock ups, let’s start coding. I will be using Xcode 4.6.2, it is the latest at the time of this writing If you have never developed in Objective-C but did some other coding in C++ or C for example it should be pretty simple to catch up. I personally haven’t touched C or C++ since college, some 15 years ago. Even with knowledge of Java and C#, I was able to pick up Objective-C. I highly recommend reading iOS Programming: The Big Nerd Ranch Guide as well. Create a blank project Open Xcode from your dock. If it’s not on your dock,…

iOS Tutorial