Nitin Aggarwal has Published 156 Articles

How to hide the keyboard in Swift by pressing the return key?

Nitin Aggarwal

Nitin Aggarwal

Updated on 28-Feb-2023 12:14:04

2K+ Views

In this article, you will learn about how you can hide the keyboard while editing text in the UITextField. In this example, you will hide the keyboard by pressing the return button on the keyboard. In the Swift language, UITextField class provides us with some delegate methods. They called ... Read More

How to change the font of UIButton with Swift?

Nitin Aggarwal

Nitin Aggarwal

Updated on 28-Feb-2023 12:12:57

8K+ Views

In Swift, this is very easy to change the font of a button. You can use the titleLabel property of the button which is of type UILabel class. This property provides another property called font to apply the desired font. Let’s see some examples of changing the font. We will ... Read More

What are the new features in Swift 4.0?

Nitin Aggarwal

Nitin Aggarwal

Updated on 05-Jan-2023 10:47:31

347 Views

In this tutorial, you are going to learn what changes have been released in Swift 4. Every time, Apple releases major versions with lots of improvements and additions to APIs. The new features introduced in Swift 4.0 include improved key paths for key-value coding, encoding and decoding, multi-line string literals, ... Read More

Precision String Format Specifier In Swift

Nitin Aggarwal

Nitin Aggarwal

Updated on 03-Jan-2023 10:32:41

1K+ Views

It is sometimes necessary to format strings in a custom format in order to use them in an application. For example, you can format product prices, decimal-point numbers, etc. In Swift, you can use precision specifiers to specify the number of decimal places or the number of characters to be ... Read More

How to use a Background Thread in Swift?

Nitin Aggarwal

Nitin Aggarwal

Updated on 03-Jan-2023 10:26:51

7K+ Views

In this article, you will learn how you can perform a task in the background using a background thread in the Swift language. Swift provides us with several ways to perform background tasks. One popular option of theirs is GCD (generally called Grand Central Dispatch), which is a low-level API ... Read More

How to define Optional Methods in the Swift Protocol?

Nitin Aggarwal

Nitin Aggarwal

Updated on 03-Jan-2023 10:25:17

895 Views

This article will explain to you how to define optional methods in the protocol. Before diving into making optional methods in the protocol, you will first learn what a protocol is and how to declare one in Swift. What is The Protocol? A protocol is a type that defines a ... Read More

How do I get the version and build number of an application using Swift?

Nitin Aggarwal

Nitin Aggarwal

Updated on 03-Jan-2023 10:22:21

5K+ Views

You often need to deal with the version and build number of the iOS application. It helps you to perform debugging operations on the server side. You can check which version or build the client (IOS app user) has. Based on that, you can debug the issues coming from the ... Read More

How do I convert a Swift array to a string?

Nitin Aggarwal

Nitin Aggarwal

Updated on 03-Jan-2023 10:18:55

2K+ Views

Let's look at some examples of how to convert an array to a string. Method 1:Using Joined(seperator:) Syntax Swift provides us with a method joined(separator:) of an array that can be used to convert a Swift array to a string. This method returns a new string by concatenating the elements ... Read More

How do I concatenate or Merge Arrays in Swift?

Nitin Aggarwal

Nitin Aggarwal

Updated on 03-Jan-2023 10:15:57

6K+ Views

Swift provides us with two different ways to concatenate or merge arrays in the Swift language.  You can use the + (plus) operator or the append() method. You will see other methods also of how you can merge multiple arrays in Swift. These methods are − Using plus (+) ... Read More

Does Swift have a Trim Method for Strings?

Nitin Aggarwal

Nitin Aggarwal

Updated on 03-Jan-2023 10:09:55

2K+ Views

In Swift, you can use the trimmingCharacters(in:) method of the String type to trim parts of a string. It is an instance method that returns a newly created string made by removing the applied character set. This method accepts a parameter of type CharacterSet to perform leading and trailing characters. ... Read More

Advertisements