Have any Question?

You can ask below or enter what you are looking for!

Month: November 2017

In-Out parameters in Swift

By default function parameters are constants in Swift. If you attempt to change a parameter within a function you will get a compiler error. To Solve this issue and enable a function to have an effect outside its scope we should use In-Out parameters.

Working with Dates in Swift

Working with Dates in Swift To start working with dates in iOS you must be familiar with at least these three objects: Date, DateFormatter and DateComponents. Date struct Date is a struct that belongs to the Foundation framework. It represents a specific point in time independent of any calendar or . . . Read more

Custom header view from xib for UITableView

In this step by step tutorial we will create a custom header view to use in UITableView and it will be loaded from xib file. Creating the UITableViewHeaderFooterView class and xib 1- First of all create a new Swift file and make it subclass of UITableViewHeaderFooterView and name it “DemoHeaderView”

Working with CALayer

What is CALayer CALayer is an object responsible for drawing and animations and it is part of Core Animation framework. It is always used as backing store for UIViews to manage visual content but it can be also used without views. If it was created by a view the view . . . Read more

UIViewController lifecycle explained

UIViewController Lifecycle In this tutorial we will explain the lifecycle of UIViewController in iOS, these methods will run in the following order: 1- init?(coder aDecoder: NSCoder) If you are using storyboards this is where the controller is initialized, it is called one time only during the view controller lifetime. 2- loadView() . . . Read more

How to change UITextField placeholder color in Swift 3 and Interface Builder

You can change UITextField placeholder color programmatically or using interface builder Changing UITextField placeholder color in Swift 3 1- Create a new UITextField subclass and  override its layoutSubviews() and insert in it this line of code self.setValue(UIColor.init(red: 178/255.0, green: 34/255.0, blue: 78/255.0, alpha: 0.5), forKeyPath: “_placeholderLabel.textColor”)