Viewing: Xcode

Assertions supported in XCTest

Here you can find the list of Assertions supported by XCTest and it is essential to know all these assertion if you are practicing Test Driven Development in IOS. You can get this list from XCTestAssertions.h XCTFail(<#format...#>) - This unconditionally fails the test. XCTAssertNil(<#a1#>, <#format...#>) - Failure message when object is not nil. XCTAssertNotNil(<#a1#>, <#format...#>) […] Read More

Content Priority in Auto Layout

Auto Layout brings in lots of good features to ease the life of an iOS developer when designing User Interfaces. In this example, we will see how to use Content Priorities such as Content Hugging and Comrpession Resistance.I have created a project with Single View Template and dispayed Size Classes as we are going to […] Read More

Search photos on Flickr – Web Service

In this tutorial we will see the steps required to write a demo app that retrieves photos from Flickr based on search text and display them in a UICollectionView. This also covers how to integrate 3rd party libaries using CocoaPods.Add a new file (Photo.swift) to act as a place holder for storing photo details. Photo […] Read More

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 articleSimple collection view demoDisplaying data in Collection ViewImplementiing Custom Cell Adding Section HeadersHighlighting CellInsert CellDelete CellsWhen the CollectionView loads, we […] Read More

Auto Layout in iOS

Using Auto Layout feature developers can align UI controls for different devices, screen sizes and orientation. This reduces the code to be maintained and makes life easy for the developers. Auto Layout solves UI design issues by creating relationship between the UI elements. This follows constraint based layout system where you can define contraints for […] Read More

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 asA module is a single unit of code distribution—a framework or application that is built and shipped as a single […] Read More

How to customize status bar in iOS

Status Bar appears at the top of your device displaying information such as battery left in your device and carrier details. The default style of status bar is black and looks as shown in the below screenshot.But if your screen designs are dark then you can change the status bar style to Light Content. This […] Read More

Tab Bar Controller with WebView

In this article, we will see step by step instruction on working of Tab Bar Controller, UIWebView and Activity Indicator by loading couple of web pages using UIWebView in two different Tabs.The project comes with a default ViewController.swift file which is mapped with the first View Controller. Let us give a proper name to this […] Read More

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. Navigate to Project navigator and select Main.storyboard file. We are not using the […] Read More

Navigation Controller in iOS

Navigation contollers are quite commonly used in iOS App. Navigation Controllers contain stack of view controllers and provide a drill down approach for accessing the child view controllers. The top bar in a navigation controller is called the navigation bar which normally contains the title of the screen. The navigation bar in child View Controller […] Read More

1 2 6