How to Compare 2 Arrays in Swift (Basic & Advanced)
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
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)
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
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
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
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
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
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
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
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…