Author: Sergey Kargopolov

Software developer

Web: www.appsdeveloperblog.com

The addTeardownBlock(_:) runs right after the test method ends and before the instance’s tearDownWithError() method is called. Below is an example of a TestCase class that does not test anything and only demonstrates the order in which the setUp() and tearDown() methods are called. When will the addTeardownBlock(_:) run? The addTeardownBlock will run after the test method is…

Read More addTeardownBlock Example in XCTestCase

In this tutorial, you will learn how to read user current location(latitude and longitude) and also how to listen for location updates continuously. Configure Info.plist To make your iOS app be able to read the user current location, it needs to prompt a user for permission to do so. The user will see an alert dialog…

Read More Determine User’s Current Location Example in Swift

In this tutorial, you will learn how to create UISlider in Swift programmatically. UISlider is a UI control that is used to select a single value from a continuous range of values. Below is an image of UISlider control. Create UISlider Programmatically To create UISlider control programmatically, you need to create a new instance of…

Read More Create UISlider in Swift Programmatically

In this tutorial, you will learn how to create both a one-dimensional and multidimensional arrays in Swift. After reading this tutorial, you might also be interested in learning how to use FlatMap and Map when working with arrays. How to Use flatMap in Swift. Code Examples, How to Use map(_:) in Swift. Code Examples, Ways…

Read More Multidimensional Array Example in Swift

In this tutorial, you will learn how to create a UICollectionView programmatically in Swift. You will learn how to create a new UICollectionView with UICollectionViewFlowLayout and will learn how to make it display a few cells. You will also learn how to make your UIViewController conform to a UICollectionViewDelagate to handle events when user taps on…

Read More Create UICollectionView Programmatically in Swift

In this tutorial, you will learn how to create an instance of @LoadBalanced RestTemplate and make it communicate with an internal microservice. For a step by step series of video lessons, please check this page: Spring Boot Microservices and Spring Cloud. Create RestTemplate Bean To create an instance of RestTemplate, you will need to first…

Read More @LoadBalanced RestTemplate Call Internal Microservice

In this tutorial, you will learn how to add days, months or years to the current date in Swift. To work with dates I will use Date(), DateComponents() and Calendar objects. I will first get the today’s current date and then will use the DateComponents() to add to a current date another day, month or…

Read More Add Days, Months, Years to Current Date in Swift

In this Swift tutorial, you will learn how to encode UIImage data to Base64 string. To verify that the UIImage data was correctly encoded into the Base64 string, we will decode the Base64 string back into image data and will create a new UIImage using this data. Create UIImage Before I can encode existing image…

Read More UIImage Base64 Encoding and Decoding in Swift

In this Swift tutorial, you will learn how to make UIImageView corners rounded. To learn how to programmatically create new UIImage, add it to UIImageView and make it visible in your app, have a look at the following tutorial: Create UIImage and UIImageView Programmatically Create UIImage and UIImageView To make image corners rounded, I will…

Read More UIImageView Rounded Corners in Swift

In this tutorial, you will learn how to create UIImage and UIImageView in Swift programmatically. Add Image to Xcode Project For your app to be able to display an image, the image needs to be either added to your app bundle or loaded from the Internet using an image URL. For this tutorial, I will…

Read More Create UIImage and UIImageView Programmatically

In this tutorial, you will learn how to read and cancel local user notification request(UNNotificationRequest) or how to remove the pending or even delivered notifications from a User Notification Center UNUserNotificationCenter. To learn how to create, schedule and display user local notifications read the following tutorial:  User Local Notifications with UNUserNotificationCenter. Notification Request Identifier When a UNNotificationRequest…

Read More How to Read and Cancel Local Notification Requests

In this tutorial, you will learn how to create, schedule and handle local alert Notifications using the UNUserNotificationCenter in Swift. Local Notification vs Push Notification One of the main differences between Local notification and a Push notification is that local notifications are created, scheduled and are sent from a user iOS device. Push notifications are…

Read More Local User Notifications with UNUserNotificationCenter