Swift

Everything about the Swift programming language, from basic to advanced, from simple to complex

How to Compare 2 Arrays in Swift (Basic & Advanced)

Updated: May 4, 2023 By: Khue

When developing apps with Swift, there might be cases where you need to check whether 2 given arrays are equal or not. In Swift, 2 arrays are considered…

Different Ways to Create an Array in Swift

Updated: April 17, 2023 By: Khue

An array in Swift is a collection of values of the same type that are stored in an ordered list (with that being said, it’s possible to construct…

Swift Cheat Sheet (Updated)

Updated: March 5, 2023 By: Khue

This comprehensive Swift cheat sheet covers the key concepts and most commonly used language features, syntax, and best practices (note that programming experience is required to get the…

3 Ways to Generate Random Strings in Swift

Updated: February 23, 2023 By: Khue

This practical, succinct article walks you through 3 different ways to generate a random string in Swift. Without any delay, let’s get started. Using UUID UUID stands for…

How to Split a String into an Array in Swift

Updated: February 23, 2023 By: Goodman

In Swift, you can split a string into an array by using the split() method. The split() method Syntax: Where: Now, it’s time to write some code. Examples…

Swift: 3 ways to count the occurrences of words in a string

Updated: February 23, 2023 By: Khue

This concise, example-based article walks you through 3 different approaches to counting the occurrences of words in a given string in Swift. Without wasting any more time, let’s…

Swift: Remove Leading and Trailing Whitespace of a String

Updated: February 23, 2023 By: Wolf

This practical article walks you through a couple of different examples that demonstrate how to remove leading and trailing whitespace, separately or together, from a string in Swift….

Swift: 4 Ways to Find the Length of a String

Updated: February 23, 2023 By: Khue

This concise, example-focused article walks you through 4 different approaches to getting the length of a given string in Swift. Without any further ado, let’s get our hands…

Swift: 3 Ways to Check if a String Contains a Substring

Updated: February 23, 2023 By: Khue

This succinct, practical article walks you through 3 different approaches to checking if a string contains a substring or not. Without any further ado, let’s get started. Using…

2 Ways to Reverse a String in Swift

Updated: February 23, 2023 By: Khue

When developing applications with Swift, there might be cases where you need to reverse a given string. For example, reversing a string can help you check if it’s…

1 4 5 6 7