Viewing: Xcode

Fix for Directory not found for option error in Xcode

You might see Directotry not found for option error when opening an iOS 8 existing project in Xcode 7. This error because of the invalid path sepcifed from the Framework Path for the test target,(null): Directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/Developer/Library/Frameworks'This can be fixed by selected the test target, navigating Search Paths and removing the […] Read More

TableView Demo in Swift

In this tutorial, we will see some of the common UITableView operations such as Adding, Updating, Deleting and Moving records using Swift. Let us start with a TableView placed over a ViewController instead of using UITableViewController. By this way you will learn lot more about the functionality of UITableView. Add a new file and select […] Read More

Memory management in Swift

Memory management in Swift is done by Automatic Reference Counting or ARC. Whenever a variables holds an instance of a object the memory count for that object increases by 1. And when variable become out of scope or set to nil, the memory count decreases 1. In the above example, we are creating two instances of […] Read More

How to display line numbers in Xcode

Listed below are the steps to display line number in Xcode editor window. This is quite useful when you are working in a ground and want to communicate the line number of statement to other members. Click Xcode menu option and select Preferences from the menu list In the Preferences window, click Text Editing tab. […] Read More

XCode Playground Overview

Playground is an interactive work environment that allows you to see the values in the sidebar for the written code. As and when you make changes to your code the sidebar reflects the changed result. Listed below are some examples written using Swift language in PlaygroundIn the below screenshot, you can observe that the sidebar […] Read More

How to record and play sound in Swift

In this tutorial, we are going to see the required steps to record and play sound in Swift Programming language using AVAudioRecorder and AVAudioPlayer Download source code from github (SoundController.swift) User Interface The user interface for this demo is simple with two buttons, one for recording and another for playing sound. Create corresponding IBAction and […] Read More

UITextFieldDelegate in Swift

This is a beginners tutorial on UITextFieldDelegate in Swift. We are going to see how to use UITextFieldDelegate by writing a Simple Interest Calculator. Download the source code from here This calculator uses UILabels and TextFields for displaying and accepting amount and interest. We are going to use the UITextFieldDelegate method to navigate from "Principal […] Read More

SplitViewController example in Swift

This is a beginners tutorial on SplitViewController using Interface builder with programming language as Swift. There are also some good articles available on SplitViewController, check them out as well - nhipster and whoisryannystrom. Create a new Single View Application. Choose Language option as Swift and provide a product name. Navigate to Main.Storyboard and select default […] Read More

Debugging Swift App in Xcode

Any beginner iOS developer should be aware of the NSLog statement. This is quite frequently used to debug Objective-C programs. In Swift you can use println or print statement instead of NSLog to write the debug information to the console log. This will write the following message in the console log.input number is 5But debugging a […] Read More

Test Driven Development in Swift

Here is a beginner tutorial on TDD in Swift by writing a program that checks for a prime number. Let us start by creating a new project, selecting template as Single View Application. Though we won’t be adding anything to the storyboard as we will focus only on the business logic. After creating the project, […] Read More

1 2 5