Swift

In this tutorial, you will learn how to disable the rotation of UIViewController embedded into UINavigationController 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: Override shouldAutorotate Function in UIViewController To begin, you need to override the shouldAutorotate function in your UIViewController subclass.…

Read More Disable Rotation of UIViewController Embedded into UINavigationController

In this tutorial, you’ll learn how to determine the main screen’s height and width in both UIKit and SwiftUI. You need to know this if you want your mobile apps to adapt to different screen sizes and orientations. If you are interested in learning how to determine device orientation and how to handle device rotation,…

Read More Determine Main Screen Height and Width in Swift

In this tutorial, you will learn how to add a playback slider to AVPlayer in Swift to control audio playback. By the end of this tutorial, you will have a working Swift code example that you can use in your mobile application. Step 1: Create AVPlayer and AVPlayerItem First, you need to import the necessary…

Read More Adding Playback Slider to AVPlayer In Swift

In this tutorial, you will learn how to play the music mp3 file from a remote URL in Swift. To play music in your mobile app, you will use two very important classes: AVPlayer and AVPlayerItem. But before I show you how to use them, I will briefly describe each one to you. AVPlayer is…

Read More AVPlayer. Play Music MP3 File From a Remote URL In 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, I will guide you through the process of integrating biometric authentication into your iOS application using Swift and the LocalAuthentication framework. By the end of this tutorial, you will have a functional app capable of authenticating users using the built-in biometric sensors of their devices. Step 1: Import Local Authentication Framework First,…

Read More Integrate Touch ID and Face ID for Biometric Security in iOS

In Swift, UIDatePicker is a user interface component that allows users to select a date or time. In this tutorial, I will show you how to create UIDatePicker programmatically. Step 1: Create an Instance of UIDatePicker and Set the Frame Inside your view controller’s viewDidLoad() method, instantiate a UIDatePicker and define the size of the frame. // Instance of…

Read More Create UIDatePicker programmatically in Swift