Swift

In this tutorial, you will learn how to create UIImageView programmatically and how to load an image from a remote URL.  I’ll show you how to create a UIImageView and UIImage programmatically, and teach you how to fetch and display an image from a URL. Step 1: Creating UIImageView Programmatically First,  let’s create a UIImageView programmatically. UIImageView is a…

Read More UIImageView and UIImage. Load Image From Remote URL.

UIStepper is a control in iOS that is used to increment or decrement a numeric value. In this tutorial, you will learn how to create a UIStepper programmatically, add it as a subview, position it in the center of the UIView, make the UIStepper value continuously increment when a user taps and holds the button,…

Read More Create UIStepper Programmatically in Swift

In this tutorial, you will learn how to customize UINavigationBar appearance programmatically within a UIViewController. You will use the new UINavigationBarAppearance introduced in iOS 15, but I will also provide a fallback for earlier versions. Set the Navigation Bar Background and Title Color For iOS 14 and Earlier Before iOS 15, you would have to…

Read More Customize Navigation Bar Programmatically in Swift

In this tutorial, you will learn how to make UIImage circular programmatically in Swift. Making a UIImage circular programmatically in Swift involves several steps. Step 1: Create a UIImageView with Your Image First, you need to create a UIImageView instance within your UIViewController. Then set the image you want to display  UIImageView by initializing it with a…

Read More Make UIImage Circular Programmatically

In this tutorial, you will learn how to create UISegmentedControl programmatically in Swift. A UISegmentedControl is a horizontal control that consists of multiple segments, each segment functioning as a discrete button. You can use UISegmentedControl to create custom user interface elements for your app, such as a switch or a filter. Creating a UISegmentedControl programmatically…

Read More Create UISegmentedControl in Swift Programmatically

In this tutorial, you will learn how to create and customize UISlider programmatically in Swift. Creating and customizing a UISlider programmatically in Swift involves several steps. Here’s how you can do it: Step 1: Create UISlider Programmatically First, you need to create a UISlider programmatically. You can do this by creating a new instance of the…

Read More Create UISlider Programmatically in Swift

In this tutorial, you will learn how to create and customize UISwitch programmatically in Swift. Creating and customizing a UISwitch programmatically in Swift involves several steps. Here’s how you can do it: Step 1: Create a basic UISwitch First, import the UIKit framework and create a new class that inherits from UIViewController. Inside the viewDidLoad() method, instantiate a new UISwitch object.…

Read More Create UISwitch in Swift Programmatically

In this tutorial, you will learn how to set the UITextField keyboard return button as the Done button and handle the Done button to dismiss the keyboard. Simply the UITextField is a control that displays editable text and sends an action message to a target object when the user presses the return button. If you are…

Read More Set UITextField Keyboard Return Key as Done button And Dismiss Keyboard

In this tutorial, you will learn how to create a UITextView programmatically, position it at the center of the view, change its background color, and dismiss the keyboard when the user taps away. You will also create a UITapGestureRecognizer, add it to the main view, and add the UITextView as a subview. Finally, you will create…

Read More Dismiss UITextView Keyboard When User Taps Away

In this tutorial, you will learn how to create and customize UITextView programmatically in Swift. Creating and customizing a UITextView programmatically in Swift involves several steps. Here’s how you can do it: Step 1: Create UITextView Programmatically To create UITextView programmatically, you will need to first create an instance of UITextView. This can be done…

Read More Create and Customize UITextView Programmatically in Swift

Creating a UITextView programmatically in Swift involves several steps. This tutorial will guide you through creating a UITextView, positioning it at a specific location within a view, centering it, changing its text color, and altering its background color. Step 1: Create UITextView Programmatically To create UITextView programmatically, you first need to create an instance of…

Read More Create UITextView Programmatically in Swift