Category: ios
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…
Generate random numbers – Example of motion and touch event
Let us see how to use motion and touch event in iOS by looking through a simple project that displays random number. This project displays random number on a label for a touch and motion event. Check out this link for more about events in iOS After creating a single view application, add a new…
Test Driven Development in iOS – Beginners tutorial – Part 2
This is in continuation of the Test Driven Development in iOS – Beginners tutorial and this covers writing XCTest user interfaces in iOS. AddingTwoNumbers app will have following controls 1. Three textfields – For entering the numbers and displaying the result. 2. Two buttons – Add button to perform addition and Reset button to clear…
Test Driven Development in iOS – Beginners tutorial – Part 1
This is a beginner tutorial on TDD in iOS, explained with an example app that adds two numbers. Let us see try to use some XCTest assertions supported in iOS in this project. Create a New iOS project select the template as Empty Application Enter the required details in Choose options for your new project…
How to disable arc for specific classes in Xcode
Xcode provides option to disable arc only for specific classes by providing a compiler flag. This is quite useful when you are including framework written prior to iOS 5 in your project. Let us see the steps required for specifying the compiler flag in Xcode. In the above screenshot, you can see errors rested ARC…
Quickly copy photos in to photos album in iOS Simulator
Photos Album in iOS Simulator is generally empty and if you are writing apps using Photos functionality then you might need some photos in them. Listed below are the steps for placing photos under the Photos Album in Simulator. Step 1: Access the Home screen on iOS simulator. (Hardware > Home) If you tap Photos…
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 add annotation to MapView in iOS
This article provides the steps for adding annotation to a MapView in iOS Updated: – Click here for the updated article in Swift Create a new Xcode Project – File > New > Project. Select the template for the project as Singe View Application under iOS > Application. Then provide the required details in the…