Posts from Swift

Return multiple values from a function in Swift

By Faruque Ahamed Mollick

You can return multiple values from a function in Swift programming. But not in a generous way. It is a bit tricky to perform this task. In order to return multiple values from a S.... Read More

Get common elements between two arrays in Swift

Get common elements between two arrays in Swift

By Faruque Ahamed Mollick | July 3, 2022

After this Swift tutorial, you will be able to learn how to get common elements from two different arrays. Finding common items between two arrays is quite an easy task. Let’s see the code below: let homeDevices = ["Macbook", "Doorbell", "Smartphone", "TV", "Refrigerator"] let officeDevices = ["Air Conditioner", "Macbook", "Mouse", "Refrigerator", "CPU"] // Create new [&h Read More

Parsing a JSON Array in Swift

By Aryan

JavaScript Object Notation, or JSON, is a text-based data format that is used to store and transfer data across web and local networks. JSON is the most popular data format used in.... Read More

Tuples in Swift

By Aryan

In Swift, Tuples are another form of collection data type, that can store more than one value of different or same types. What makes Tuples unique from Arrays is that Tuples can st.... Read More

Closures in Swift

By Aryan

In this tutorial, we will cover the uses of closures in Swift. A Closure is a type of special function, unique to Swift, that can be made without the function name. It is basically.... Read More

Convert a String to an Integer in Swift

By Faruque Ahamed Mollick

In this Swift programming tutorial, you will learn how to convert a string to an integer. In the field of app development, you often need to convert a string into an integer so tha.... Read More

Nested Functions in Swift

By Aryan

Similar to Nested if-statements, when a function co-exists within the body of another function is called a Nested Function. There are 2 main parts to a Nested Function, the inner f.... Read More

How to find size of an array in Swift

By Shubhodh Amaravadi

In this tutorial, we are going to learn how to find the size of an array in Swift. There are two ways to get the total number of elements in the array. They are: Using count proper.... Read More

Related Posts