Kotlin for Swift Developers and vice versa — part I

Swift and Kotlin Variable Types

Navdeep Singh
2 min readApr 1, 2023


Photo by Marc Reichelt on Unsplash

I am an iOS engineer and Swift is my language of choice but lately I started learning Kotlin and while learning I found out the similarities between both the languages. So, I thought of capturing the similarities to help other engineers out there who are planning to learn Kotlin as Swift developers or vice versa.

In this blog post you will read about Swift and Kotlin variable types.

Variables/Mutable types

A variable is a way of giving a name to a piece of data so that we can reference it later in program execution.

Declaring a variable in swift:

var name = "My name in Swift" 

Swift infers the data type and hence you don't need to explicitly mention the datatype like this:

var name: String = "My name in Swift"

When compared to swift, there is NO CHANGE when we declare a variable in Kotlin.

Declaring a variable in Kotlin:

var name = "My name in Kotlin"

Like Swift, Kotlin also infers the datatype implicitly, so there is no need to explicitly mention the datatype.



Navdeep Singh

Author of Reactive programming with Swift, Engineering Manager — Exploring possibilities with new Tech.