Viewing: Swift

How to programmatically add AutoLayout constraints?

AutoLayout solves the mystery when designing app for more than one screen size and for both Portrait and Landscape orientation. This is done by adding constraints to the views using various Auto Layout options available as part of Interface Builder. As an iOS developer, you can also add these constraints programmatically using NSLayoutConstraints or Visual […] 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

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

Optional binding and Optional Chaining

Swift has a feature that lets users to assign optional value to a variable or a constant. Optional variable or constant can contain a value or a nil value. Let us take the following example which tries to find a given string in a array of string.The searchIndex would return value if the fruit exists […] Read More

payworks SDK integration in Swift

payworks mPOS helps app developers to integrate their App with card reader. In this tutorial, we will see a sample app that integrates payworks mPOS using Swift. Download the source code from github Select New Project and choose Single View Application from the template. In the Project Options window, provide a product name and make […] 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

Integrating Stripe in Swift for iOS development

Stripe is payment gateway that can be integrated with any website and mobile apps. In this tutorial we will see a quick and simple integration of Stripe in Swift for iOS development using Stripe documentation for iOS.This hands on tutorial will help you to familiarise yourself in Validating and creating token using Stripe IOS SDK […] Read More

1 2 3