Artturi Jalli

I'm an entrepreneur and a blogger from Finland. My goal is to make coding and tech easier for you with comprehensive guides and reviews.

Optionals

In Swift, you can use optionals to represent variables and constants that could be nil or a value. Any data type in Swift can be made optional by adding a question mark after the data type name. For instance, let’s create an optional String: The value of this string is now nil. To use an […]

Optionals Read More »

Classes

In Swift, a class acts as a blueprint for creating objects. For example, here is a class that represents a person: And here you create a Person object: In this guide, you learn how to create objects using classes in Swift. Also, you are going to learn what is the distinction between a struct and

Classes Read More »

Structs

In the previous chapters, you have worked with data types like Int, String, Double. But did you know you can also implement your own custom data type? In Swift, one way to do this is by using a struct. For example: Output: In this chapter, you are going to learn how to create your own

Structs Read More »

Functions

In Swift, a function is a reusable block of code with a name. This function can then be called to perform a specific task with different inputs. When you call a function, you execute the code inside that function. To create a function, you need to: For example, let’s create a function that greets a

Functions Read More »

For Loops

In Swift, you can use a for loop to repeat code. For example, let’s use a for loop to calculate the sum from 0 to 10: Output: Loops are extremely common in Swift and other programming languages. As you can imagine, when working with data, you need to be able to repeatedly perform the same

For Loops Read More »

If-Else Statements

In Swift, you can use an if-else statement to let your program make decisions. For example, let’s check if a person can drive based on their age: This results in the following output in the console: If-else statements are everywhere. They are the basic building blocks of programming. With if-else statements, you can start implementing

If-Else Statements Read More »