Swift Array
Swift Array Array in Swift is used to store an ordered collection of values of any type (we can have more than one type in an array). Arrays that are defined as a var are mutable whereas the ones defined with let are immutable. An example of each is given below: import Foundation var arrayOfStrings:[String] = [“Hello”, “Playground”] let constantArray:[String] […]
Swift Class
Swift Closure
Swift Closure Closures are self-contained blocks of functionality that can be passed around and used in your code. Closures can capture and store references to any constants and variables from the context in which they are defined. The concept of Swift Closure is similar to blocks in C. Closures are nameless functions and without the keyword func. Closures […]
Swift Controle Flow Statements
Swift Controle Flow Statements We’ll be looking into the wide variety of statements that Swift has to offer. We’ll be largely covering swift for loop, swift while, repeat-while, and switch statements. If you’d like to use an online compiler for Swift, go for https://iswift.org/playground Swift for loop To iterate over a sequence without using subscripts […]
Swift Dictionary
Swift Dictionary Swift Dictionary is a collection of key-value pair elements. They are an unordered list of values of the same type with unique keys. Under the hood, they are just HashTable. Hashtable is a data structure composed of Arrays and a hash function, to say the least. They are very useful when you need […]
Swift Error handling – Swift try, do catch, throws
Swift Error Handling Swift error handling is a very important aspect of writing better code. Swift try statement is used for error handling in swift programs. Let’s get started by launching XCode playground. Swift Error Handling is all about handling the failing conditions gracefully An error can lead to run time errors or changes in […]
Swift Function
Swift Function Swift Functions are self-contained chunks of code that perform a specific task. You give a function a name that identifies what it does, and this name is used to “call” the function to perform its task when needed. We’ll be covering the following concepts in this tutorial. Named and Unnamed parameters Default […]
swift fundamentals

Swift fundamentals In this tutorial, we’ll look into the basic syntax of swift and run it in our console. Click Get started with a playground. A playground is a new type of file that allows us to test out Swift code, experiment and play around with it and see the results of each line in […]
Swift Generics
Swift Generics Generics are used to write flexible and reusable code that can work across multiple types. So instead of creating a different function/struct for every type such as Int, String, etc, we can set a Generic type. A generic type is also known as a placeholder type. Typically when we pass typed parameters in […]