Swift Slowly: Day 21 - Hacking Swift 4

Today is all about loops.

I learned that you can’t loop over a tuple. I think this is because you can’t guarantee that every item will be the same thing.

I got to spend some time look up how to get a real going because it feels like forever to check my answers in a playground sometimes.

Swift Slowly: Day 20 - Hacking Swift 3

I want to point out that I really enjoy the brief discussions on why things are the way they are in Swift.

Why do things this way in Swift?

I got into a grove with the operator overloading and made the assumption that ** was an exponent operator.

I found myself talking through the training and that really helped me with understanding.

I think I’m in the same boat as Paul when it comes to the ternary operators.

I’m very much in the “avoid where possible” camp because even though this code is longer I do find it easier to follow:

I didn’t know that switch statements read the value they were reading once as compared to the if statement which would read it every time that it does a comparison.

Just finished the 1997 film Selena. Good movie but really depressing.

Swift Slowly: Day 19 - Hacking Swift 2

The introduction of complex data types: Arrays, Sets, and Tuples. I normally get sets and tuples mixed up hopefully not after today. I spent some time going through my older run throughs of the material.

In a previous attempt to make it through the 100 days, I had created an Xcode playground with pages for the different days.

Hacking with Swift playground

I’ll brush this bad boy off and use it to take notes. One of the gripes that I have that waiting for results feels kind of nerve wracking as I’m looking at the little spinner in the corner of the status bar.

I liked using playgrounds sometimes to see if certain lines are valid.

Using raw values with associated types

Apparently, you can’t use raw values with associated types in enums.

This one took a while, but I think this time was just a little more fun to do.

Completed!

Guess who isn’t allowed upstairs!

Swift Slowly: Day 18

Working through Paul Hudson’s excellent 100 days of SwiftUI. I thought about changing the title to reflect the fact that I’ll be going through this but decided to stick with this to show that it’s part of a greater arch.

Notable things

Having the _ as a number separator is kind of fun to think about because it reminds me that not every language looks at the comma , the same way.

I like the fact that every section that I’ve looked at has an option page on “why” something is the way it is.

A section pointing to why something is the way it is.

Overall, a very good start to an addition of my programming habit!

Our dog isn’t allowed upstairs.

waiting for the family to come down.

I feel pretty good about limiting my technical projects. Although I do have feelings that I’m missing out, the absence of that feeling of what “I should be doing X”, makes it worth it.

Swift Slowly: Day 17

The last day of my run through!

I get to run the completed application.

Tomorrow I’ll start going through Paul Hudson’s Hacking Swift tutorials.

Swift Slowly: Day 16

Work got busy and then the Country’s Capital got attacked so I didn’t put any time into my programming.

Well. It’s time to get back to it. I don’t want not working on my task to be a habit!

Section 4: History View

Purpose: Create a simple view for the history of the the user’s scrums.

The tutorial certainly reads very well, but every once in a while, you run into a scenario where I feel that they probably could have made it a little better. For example, in the history view we give the preview a string for the preview. The website doesn’t read very well in the browser page that it’s on.

Long string text in xcode

Of course, it looks a lot better when it is in Xcode.

Long code line in Xcode

I couldn’t stop messing with the code because I wanted the properties for this thing to stick out.

Long command line reformatted

I’m hoping that if I start using source control for this, I’ll be able to go back and refactor a little easier. This might just be attempting to optimize for something that doesn’t need to be optimized.

I need to do some research on how the extension keyword works in swift and at what point. Extension of the history classI think I understand that we placed it here because no other view needs to do a translation of the attendees array. A discussion on refactoring is most likely not going to be part of this tutorial.

I’m going to finish the last section tomorrow.