Tag: Apple

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

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

  • Tuples 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 let employee = (103, “Deepak”) employee.0 employee.1 Now let…

  • How to reduce size of document with images in Microsoft Word

    Microsoft Word provides users with the option to reduce the file size of the document with images. In this tutorial, we will see the technique of reducing the file size in Word 2013 and Word 2011 for Mac. Reduce images size in Word 2013 Word 2013 users can use the Compress Pictures option available as…

  • Binary search

    After a simple bubble sort algorithm (not the most efficient sorting algorithm), let us try to implement Binary search in Swift Programming Language. Binary search algorithm can be applied only on sorted arrays. So let us first generate random numbers and store them in an array. Then call the bubble sort function to sort the…

  • Bubble Sort

    The best way to practice a new language is to write more programs using that language. Here is a Bubble Sort program written in Swift Programming language. Data to be sorted = {12, 56, 32, 23, 67, 87, 45, 23,10, 11} Bubble Sort Bubble Sort is performed by comparing two number starting from the left…

  • Decode job advert posted in Swift Language

    I came across this unique Swift job advert in stackoverflow.com posted by Criteo. (Need to add override for the init function, missed in the original job post) var hello = “Hello, I am a Swift Program, paste me in the playground” var doyouswift = “You think you have what it takes to build the next…