Tag: Xcode

  • 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 Playground Sum of n numbers [code language=”swift”]var sum = 0…

  • 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…

  • 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…

  • 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…

  • 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. [code language=”swift”]var primeFlag:Bool = true println("input number is \(number)") if ((number == 2) ||…

  • 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,…

  • Remove Apple Mach-O Linker directory not found

    Listed below are the steps to remove Apple Mach-O linker warning directory not found warning message. 1. Navigate to Project Navigator, select the Project then navigate to Build Settings. 2. Under Build Settings, scroll down to Search Paths and double click on Library Search Paths. 3. Select the missing folder paths and remove them using…

  • Apple Mach-O Linker error – Xcode 6 Beta 6

    After downloading Xcode 6 beta 6, If you are receiving Apple Mach-O Linker error, Undefined symbols for architecture then try clearing the DerivedData for Xcode. Undefined symbols for architecture x86_64: “__TFSs26_forceBridgeFromObjectiveCU__FTPSs9AnyObject_MQ__Q_”, referenced from: Derived data folder location You find out the location of derived data using Xcode Preferences. Click Xcode -> Preferences. Click Locations tab…