Swift

In this tutorial, you will learn how to drop a MKPointAnnotation pin on a MapView at user’s current location programmatically in Swift. By the end of this tutorial, you will have a working Swift code example that you can use in your mobile application. Step 1: Import MapKit and CoreLocation Firstly, you need to import…

Read More Drop a MKPointAnnotation Pin on a MapView at User’s Current Location

WKWebView is a powerful class in the WebKit framework that allows you to embed web content in your iOS app. It’s essentially a mini-browser that provides a rich, interactive web experience within your application. Unlike UIWebView, which was deprecated and removed from iOS 12 onwards, WKWebView is more efficient, has better performance, and offers advanced features like…

Read More Create WKWebView Programmatically and Load Webpage URL

Local notifications are a powerful feature that allows you to engage with your users by sending timely reminders, updates, and alerts directly to their devices. In this tutorial, you’ll learn how to implement local notifications in SwiftUI, focusing on two types of triggers: time interval and calendar. I’ll start by explaining how to request notification…

Read More Create, Schedule and Receive Local Notifications in Swift

In this tutorial, you will learn how to determine a user’s current location in Swift using CLLocationManager and CLLocationManagerDelegate. CLLocationManager is the class that you use to start and stop the delivery of location-related events to your app. You can use it to track the user’s current location, report heading changes, monitor regions of interest, and range nearby…

Read More Determine User’s Current Location in 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