Swift Demo – Add Progress Bar

In this short tutorial, we will see the steps required to add UIProgressView to a Swift IOS Project.UIProgressView and UILabel showing the current progress will be added programmatically to the View Controller. Create a Single View Application and navigate to ViewController.swift file.Add the following code snippet below the class definition. This code snippet adds variables […] Read More

Create new Test Target in Xcode

Listed below are the steps to add test target for an existing iOS Projects (iOS 6.0 and older).Click File menu -> New and Select Target from the menu list.Then select Cocoa Touch Testing Bundle under iOS -> Other template section.Enter product name for the new target and other details and click FInish.Now you should be […] Read More

Automatically take calls on iPhone speaker

iPhone users have the option to automatically take the calls in Speaker. Listed below are the steps to enable iPhone to receive phone calls in Speaker.Step 1: Tap the Settings icon on the Home screen.Step 2: Navigate to General option in Settings screen.Step 3: Select Accessibility option in General Settings screen.Step 4: Scroll down the […] Read More

DatePicker Demo in Swift

In this short tutorial, we are going to see the steps required use DatePicker in a iOS / Swift project. This demo is done by adding the DatePicker controls to Interface Builder and not programmatically.Now add a new file to the project and choose the template as Cocoa Touch class. Provde the name for your […] 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

Closures, Extensions and Generics in Swift

Closures are self contained lines of code that can be passed around the application and similar to blocks in Objective-C. A typical closure syntax in Swift looks as shown below In the above code example, a closure has been assigned to a variable. The purpose of this closure is to concatenate the string parameters and return […] Read More

Tuples, Enums and Protocols in Swift

Tuples in Swift allows user to assign group of values to a variable, constant and even return parameter of a function. In the below example, a employee constant is assigned Int and String values. And to access these parameters, we need to use .0 and .1Now let us say you want to assign proper name […] Read More

Class and Struct in Swift

Download the playground file from github (Classes and Struct)A class is a blue print for a real-word entity such Player, Person etc. and it is used for creating objects. Class can have properties to store values and methods to add behaviour. Let us see this with an example class called Rectangle which has some properties […] Read More

Swift – Beginners Tutorial

Swift is the latest programming language released by Apple for developing OS X and iOS apps. Best of C and Objective-C Adopts safe programming patterns and modern features Supports Playground, a tool for seeing the result immediately. Provides access to Cocoa libraries and can work in conjunction with Objective-C Combines Procedural and Object-Oriented programming. No […] Read More

1 2 3 4 10