Xcode 6 Tips: Vector Images, Code Snippets and Many More

As a developer, no matter whether your are a professional one, or you are just doing programming for fun, it’s definite that you are going to spend endless hours in front of your monitor until your project is ready. Feeling comfortable with the programming tools you use is more than important, as they consist of your virtual workplace and everything defines the working conditions. And when I say “everything”, I mean it: From the applications that you’ll choose to use as tools, down to the last possible setting you may apply to any of them. Undoubtably, a friendly environment can boost up your performance; a less friendly, non-customizable programming tool can have the exact opposite effects, as your productivity can be dramatically reduced. For example, you may feel that you are fed up working with the same “ice-looking” tool without being able to modify its display settings, or you feel eye strain because characters are too small, or because you have to use the mouse because setting your own key combinations isn’t possible.


So, hoping that I’ve made my point clear, let me make things more specific. As an iOS (and probably a Mac) developer, it’s quite possible that you use Xcode as your primary IDE (Integrated Development Environment) for developing your projects. I’m saying that is possible, because there are alternate applications you could use instead of Xcode. However, as most of developers use it, I’m going to stick to it. Anyway, Xcode is a powerful IDE, with numerous options and possibilities, and in its sixth version (in the time of writing) has nothing to be jealous of other IDEs. Each new version of it brings new features, making programmers’ lives easier. However, we all have to admit that Xcode is not perfect; It still has flaws, some of them quite annoying. But yet, it’s a great tool, and thankfully, Apple makes remarkable efforts to eliminate all flaws and bugs with every new update. In short, despite any flaws, Xcode is a great tool to work with.

Xcode, as any other programming tool, comes with some predefined settings. Its initial state serves the majority of the developers even from the first use, once it has been installed. With no doubts, Xcode has a great number of features, and for new developers or first-timers might look chaotic. Well, it’s a fact that not all options are for everybody. For example, if you don’t use versioning control, you’ll probably never going to use the respective feature. Or, unless you develop a really large project, you’ll probably never going to use bots for testing. But, no matter what you’re going to use or not, you must face one thing: Xcode is not made of stone, and it can be customized in many ways, so you can feel as comfortable as possible when working with it, and at the same time being extra-productive.
[Read more…]

A Beginner’s Guide to Animated Custom Segues in iOS 8

When the fifth version of iOS (iOS 5) was released to the public, it introduced a brand new, revolutionary approach to the way the interface of an application was designed. That was the use of storyboards, and it was meant to change the existing designing philosophy from the ground up. Before iOS 5, each view controller had almost always an accompanying Interface Builder file, known as nib or xib, and the idea was simple: The interface of each view controller was supposed to be designed in the respective nib file, whereas all the nibs together were composing the full interface of the application. From one hand, that was handy because developers could only focus on the interface they were designing at the time, but on the other side, too much files were eventually had to be created, and even more, developers could not have a whole overview of the app’s interface.

Custom Segue in Storyboards

With storyboards all that became just history, as this new way has been used by almost the entire developer community. Storyboards had (and have) to offer three significant advantages compared to the old-fashioned technique:

  1. The whole interface design takes place in just one file. The total number of the files in a project is dramatically reduced, especially in big-sized ones. Using extra nib files is optional and is allowed for creating auxiliary views only.
  2. Developers have at their disposal an instant overview of the app’s interface and flow.
  3. The transitions between the view controllers (named scenes in terms of the interface design) and how they happen are now perfectly defined and clearly presented to developers.

From all the above, the transitions between scenes consist of a special chapter of the storyboards, and they’re mostly known as segues.

A segue is closely related to the navigation and handling of an application, as it actually defines the transitioning details when moving from one view controller to another. These details specify whether animation should be applied or not, what kind of animation, and of course, the preparation and performance of the actual transition. But not just that. A segue can also be used to pass data to the view controller that’s about to be shown, and that’s a common case scenario for almost all developers.

[Read more…]

Working with UITableView in Xcode 5 Using Storyboard

When we first started the iOS programming course, we wrote a tutorial about UITableView and showed you how to create a simple table app using UITableView. This is one of our most popular tutorials. However, you may find it no longer works in Xcode 5. The latest version of Xcode promotes the use of Storyboard over Interface Builder. Storyboard is no longer an option when creating a new Xcode project. It’s the default. This is one of the reasons why you couldn’t follow the steps in the UITableView tutorial to create the app.

Anyway, we decide to completely update the table view tutorial for Xcode 5 and iOS 7. And here you are.

Enter the UITableView tutorial.

First, what’s a Table View in iPhone app? Table view is one of the common UI elements in iOS apps. Most apps, in some ways, make use of Table View to display list of data. The best example is the built-in Phone app. Your contacts are displayed in a table view. Another example is the Mail app. It uses Table View to display your mail boxes and emails. Not only designed for showing textual data, Table View allows you to present the data in the form of images. The YouTube and Airbnb apps are great examples for the usage.

Sample UITableView
[Read more…]

Create Static Table View Using Storyboard

After we published the iCloud programming tutorial, the first question from our readers is not about iCloud but related to the static table view. If you’ve followed our tutorials, you should have a basic understanding about table view. However, the table views that we’ve covered are of dynamic content. The “Add Note” controller that we built in the previous tutorial, on the other hand, makes use of the static table view. If you have problem with static table view, this tutorial is for you. We’ll show you how to create static table view using Storyboard.

To illustrate how easy you can use Storyboard to implement static table view, we’ll build a simple Setting screen. Static table views are ideal in situations where a pre-defined number of data items to be displayed. A setting screen is an obvious use of static table view.

iOS Programming 101: Customize UITableView and UITableViewCell Background using Storyboard

In the last tutorial of our iOS Programming 101 series, we showed you how to customize the navigation bar and buttons with your own background image. This time, we’ll look into the customization and styling of UITableView and UITableViewCell.

If you’ve followed our iOS tutorials from the very beginning, you know we’ve written a tutorial about customizing table view cell using Interface Builder. In this tutorial, we’ll do something different. Instead of using Interface Builder to tweak the UITableViewCell, we’ll show you how to use Storyboards to style the cell. Storyboards make customizing table cells much easier with the introduction of prototype cell. In brief, you’ll learn the following stuffs in this tutorial:

  1. Customizing UITableViewCell using Storyboard
  2. Style UITableViewCell and UITableView with your own background images

[Read more…]

Introduction to Core Data: Your First Step to Persistent Data

Editor’s note: After we published the tutorial about saving data in plist file, some readers asked about Core Data and how we can use it to save persistent information. This week, we work with Ziad Tamim, an independent iOS developer, to give you an introduction of Core Data and work with you to build a sample app using Core Data.

This tutorial talks about persistence on iPhone (or other iOS devices). What I mean by persistence is to make data that’s in your apps stay around between application launches. Persistence lets users store persistent data and also retrieve it, so that users don’t have to reenter all their data each time they use their applications. There are multiple ways to store data in iOS devices but most of them aren’t good enough to store a complicated data. They are usually used to save settings or to preload some data such as “Property List” and “Archiving Objects”. So that’s why we’ll go through Core Data to see how you can utilize it to manage data in database.

The focus of the tutorial is to provide a practical introduction of Core Data framework. I expect you’ve already gone through our tutorials about Storyboard and UITableView. I will not give in-depth explanation about how to create view controller in Storyboard but you can always refer to the earlier tutorials to gain better understanding.
[Read more…]

Storyboard Tutorial: Create Tab Bar Controller and Web View

This is the third article of the Storyboards series. Last time, we discussed how to pass data between view controllers with segue. It should be easy, right? Now let’s continue to polish our Storyboard project and see how you can create to two other common UI elements in iPhone apps.

In this tutorial, you’ll learn:

  • How to Create a Tab Bar Controller
  • How to Create an About page using UIWebView

If you’re new to Storyboards, I suggest you to check out the first tutorial. All the materials discussed in this material are based on the work we’ve done before.
[Read more…]

Storyboards Segue Tutorial: Pass Data Between View Controllers

This is the second article of our Storyboards series. In the first tutorial, we introduced the Storyboards, which is a friendly feature in Xcode for designing user interface. If you’ve followed the tutorial from start to end, you should already build a simple recipe app with navigation interface. But we left one thing that was not discussed: data passing between scenes (i.e. view controllers) with segue.

First, let’s take a quick look at what we’ve accomplished. Previously, we learnt to use Storyboards to build a few things:

  • Embedded a normal view controller in navigation controller
  • Created a table view and populate a list of recipes
  • Switched from one view controller to another view controller using Segue

And, this is the final deliverable. When the app is launched, it displays a list of recipes. Tap on any of them will bring you to another view, that supposes to display the details of recipes.
[Read more…]

Use Storyboards to Build Navigation Controller and Table View

By now, if you’ve followed our tutorials, you should have a basic understanding about UITableView and how to build a simple app. This week, we’ll talk about something new – Storyboards. This is one of the most exciting features introduced in Xcode 4.2 and iOS 5 SDK. It makes your life, as an iOS developer, simpler and lets you easily design the user interface of your iOS app.

In this tutorial, we’ll show you how to use Storyboards to build a Navigation interface and integrate it with UITableView. We try to keep thing simple and focus on explaining the concept. So no fancy interface or pretty graphic. We’ll leave the artwork to future tutorials.

Okay, let’s get started.
[Read more…]