Category: Develop

  • Selection Sort

    Selection Sort algorithm does the same amount of comparison( N*(N-1)/2 ) like bubble sort but the number swaps (N) is reduced drastically. This sort algorithm traverse through all the items, picks the smallest number and swaps it with left most item. Then the step is repeated for the next smallest number until it reaches the…

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

  • Basic overview of Xcode

    Xcode is the primary tool used for the development of Mac and iOS applications. This is a free tool which can be downloaded from developer.apple.com website. You can use Xcode for Writing code, Building, Testing (Unit test) and for Distribution (Submitting to App Store). Different Panes in Xcode Navigator   This is available at the…

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

  • Simple UITableView and UIAlertView example

    In this article, we are going to see how to create a simple UITableView for displaying data. And display an alert on selection of any row using UIAlertView. Launch Xcode, Click File > New Project and select Single View Application as the project template. Enter the project details for Product Name, Organization Name, Company Identifier…

  • How to change page scaling in Xcode

    Xcode provides option to increase or decrease the page scaling. This page scaling option is available as part of the Page Setup. This feature is quite useful when you want reduce the number of pages used for printing any Objective-C code. The default page scale is set to 100% and you can change this by…

  • What is Delegation in iOS ?

    Delegation is one of the commonly used pattern in iOS. This is used tell an object to act on behalf of another. Refer to Apple documentation for detailed information on delegate pattern. Let us see this with an example program that uses UITextFieldDelegate. This is a SingleView Project with one UITextField control. #import “ViewController.h” @interface…

  • Different ways to connect IBAction to UIButton

    In this tutorial, we are going to see the different ways for connecting IBAction to UIButton. Let see this with an example that displays an alert message on the touch event of UiButton. Method 1 (Assistant Editor): Step 1: Drag and drop Round Rect Button from the Objects library on to Interface builder. Step 2:…