Category: Views & View Controllers
In iOS UIAlertController is not only used to output messages to user but it can also accept input text from the user.
In this tutorial we will learn how to add UITextField to UIAlertController so lets start
Learn how to display an alert message to the user in iOS using UIAlertController
UITextView is a scrollable, multiline text region and its object : “textContainer” defines where the text will be laid out.
Add gradient background to UIView using CAGradientLayer
You can design custom controls and render them in real time from Interface Builder using @IBDesignable and @IBInspectable attributes. In the following example we will create a custom UIButton and change its corner radius, border color and border width from InterFace Builder with the help of @IBDesignable and @IBInspectable attributes.
In two steps we can make a UILabel change its height dynamically without writing code. UILabel dynamic height First select your UILabel and from “Identity inspector” set number of lines property to 0. Next add Top, Trailing, Leading and Height constraints then select the height constraint and change its “Relation” . . . Read more
Removing Empty Rows from the end of UITableView Sometimes you have a table view with very few number of rows that are not covering the whole screen height. In that case Xcode will add extra empty rows to your table view which looks very unprofessional.
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”
I will go straight to the point and tell you how to send data back and forward in different situations. This code was written in Swift 3 Sending data forward using Segue If you are navigating from ViewControllerA to ViewControllerB using Segue called “toViewControllerB” then do the following steps
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