Swift Functions

Posted on Thu 13 February 2020 in swift • Tagged with swift

Onward to day 5 of 100 Days of Swift. Today was all about functions, and there were a few things that I didn't remember, mainly because I don't use them much when I code.

First up is variadic functions. I don't use these because I tend to use arrays when …


Continue reading

Swift Loops

Posted on Wed 12 February 2020 in swift • Tagged with swift

I'm stuck in a loop, doing day 4 of 100 Days of Swift again.

Only two short comments today.

First, I'd forgotten about repeat loops. Does anyone really use them?

repeat {
    print("The body of a repeat loop is always executed at least once.")
    break
} while true

Second, I also …


Continue reading

Swift Operators & Conditions

Posted on Tue 11 February 2020 in swift • Tagged with swift

Onward to day 3 of 100 Days of Swift!

Just a few tidbits today. First of all, I'd forgotten about the fallthrough keyword in a switch statement. I guess I understand the intent here, people forget to use break all the time. However, it seems like every other language's switch …


Continue reading

Swift Complex Data Types

Posted on Mon 10 February 2020 in swift • Tagged with swift

Yay, on to day 2 of 100 Days of Swift!

I'd forgotten that dictionary literals in Swift are written with square brackets, instead of with curly braces like pretty much every other language that I've used.

var languages = [
    "Alex": ["English", "Italian", "Japanese"],
    "Skyler": ["English", "German", "Latin"],
    "Hal": ["English", "German"],
]

I'd …


Continue reading

First Steps in Swift

Posted on Sun 09 February 2020 in swift • Tagged with swift

I'm tackling 100 Days of Swift again. Last time I tried it, I got sidetracked by personal stuff and bailed after a few weeks.

I've already shipped a few apps in Swift, so I'm not doing this to learn Swift from scratch. I'm trying to learn the useful patterns and …


Continue reading