Category: ios
UICollectionView Demo in Swift
UICollectionView can be used for displaying set of data in rows and columns The main difference between UICollectionView and UITableView is that CollectionView can be display more than one column. The following topics are covered in this article Simple collection view demo Displaying data in Collection View Implementiing Custom Cell Adding Section Headers Highlighting Cell Insert…
Access Control in Swift
Swift like other programming languages provides option to restrict access to classes, functions, variables, structs, enums etc applying the required Access Control. These restrictions are based on each module, as per Apple documentation a module is defined as A module is a single unit of code distribution—a framework or application that is built and shipped as a…
Add annotations and Polyline to MapView in Swift
In this article, we will see the instructions for adding annotation to MapView, Draw Polylines and Zoom to a region in Swift. Let us see this by adding stations to a Map for Chennai subrban trains and connect these stations using Map Overlay. Project Setup Create a new project by selecting Single View Application…
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 UIProgressView and UILabel Add the following code snippet below the class…
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. Date Picker Mode Date Picker control allow developers to specify the mode such as Date, Time, Date and Time and…
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…
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 .1 [code language=”swift”]let employee = (103, “Deepak”) employee.0 employee.1[/code] Now…