Blog

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

In this XCTest tutorial, you will learn how to write a unit test that will test if UIButton is connected to @IBOutlet and has @IBAction assigned. For this tutorial, I will create a Single View application project. I will use the default View Controller that XCode creates for all new projects and I will position…

Read More XCTest. Test if UIButton is Connected And Has Action

When we take the Test Driven Development(TDD) approach to write code we eventually ask ourselves a couple of questions: Have I covered all possible use cases? Have I written enough unit tests? What helps me is writing a bulleted list of functional requirements for the feature I am developing. Having a clear list of things…

Read More Swift TDD. How Many Unit Tests to Write?

When writing a Unit test for a piece of code, we need to isolate this piece of code from all other dependencies it has. These dependencies are objects of other classes that do not need to be tested in this particular unit test. For example, a piece of code we are unit testing might depend…

Read More Test Doubles in Swift – Dummy, Stub, Fake, Mock and Spy

In this short tutorial, you will learn how to set a different font on UIButton in Swift programmatically. There are lots of different customization you can with UIButton. For example, you might be also interested to learn how to create UIButton and change its style, background color, tint color and make it call a function…

Read More Set UIButton Font Programmatically in Swift