DEV Community

Davmi Jose Valdez Ogando
Davmi Jose Valdez Ogando

Posted on

100 Days of Swift - Day 1

Today I started the journey on becoming an iOS native developer. Coming from 4+ years of .Net and Xamarin experience, mobile has been my passion for a while now.

After some side gigs, I've finally managed to get a Mac. Therefore starting today I'll do my best to keep on a streak and follow Hacking With Swift 100 Days of Swift which has been suggested by a friend to start learning the language.

Summary:

Day 1 - Variables, Simple data types and string interpolation

The first day as to be expected is a run down on how the language works. Declaring strings, integers, doubles and booleans.

Coming from .Net the moment you see a var you may immediately understand that it refers to a variable, what's a little bit shocking for JavaScript enthusiasms is the fact that let is used for constants.

The variable types don't have to be specified at the time you declare them, since swift is smart enough to assume the data type given the value assigned. But in case you want to add a type right after it is done like this: let myVariable: Int = 42;. Semicolons are optionals unless you want to write multiple sentences in the same line (am sure I'll use them just like always).

For the always useful String Interpolation in swift you only need "This is a string with some value: \(variable)" for it to work, nice to remember and will try not to confuse it with "string and ${variable}".

So far so good but this are just the basics, might try to do Day 2 later too.

Top comments (0)