Category: Apple

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

  • Swift Basics – Beginners Tutorial

    Swift Basics Swift is a programming language made by Apple. It’s used for making apps for iPhones, iPads, and Macs. It takes good points from older languages like C and Objective-C but is safer and has new, easy features. Variables and Constants Data Types Collection Types Arrays Dictionaries Operators Let’s break down these concepts into…

  • Retrieve list of Twitter followers using Swift

    This article provides details about the the steps required to retrieve the followers in from your twitter account. You will learn the following by going through this article Use oAuth to retrieve bearer token. Retrieve twitter followers using API call. Last 20 followers name and profile image will be displayed in a tableview. Download the…

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

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

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

  • How to check the OS version of your iPad

    iPad allows users to check the version of OS installed using the settings menu. This would be useful when you are troubleshooting some problems in your iPad. To check the OS version 1. In the home screen, tap the settings menu. 2. In the settings screen, navigate to General settings. 3. In the General Settings…

  • Enum in Swift

    Enum group of related values to a single data type. Swift enum has lot of new features compared to its predecessor Objective-C. Let us see this with an example enum type for all Months in a year. enum Months { case January, February, March, April, May, June, July, August, September, October, November, December }  …