Cs193p


Jul. 29, 2022

@ScaledMetric

I solved the problem (well, I googled a stackoverflow result to the problem) in the previous post about the different heights of the SF Symbols. The answer was to put them in a frame and lock the height. A problem that then arises from that is that when the user changes the text size, they’ll be out of wack. Apple’s solution to that, introduced in iOS 14 is the @ScaledMetric property wrapper that does some magic I don’t fully understand yet.

Jul. 28, 2022

Memorise Assignment 1

A small milestone achieved - I’ve completed the first assignment from the CS193p lecture series - some minor changes to the app being built in the lectures. There was a couple of things I was unhappy with:

  • The text under the SF Symbols you can see in the preview above not being vertically aligned.
  • Having duplicated code in my emoji arrays:
    let animalEmojis = ["🐠", "🐢", "🦋", "🐥", "🐣", "🐰", "🐝", "🦄", "🐵", "🐛"]
    let weatherEmojis = ["🌪", "🌝", "🌈", "🔥", "🌧", "🌙", "🌬", "☃️", "☔️", "🌫"]
    let transportEmojis = ["🚗", "🚕", "🚲", "🚚", "🛵", "🚜", "🛴", "🛺", "🚃", "🚡"]

    // I'm not happy with this duplication //TODO
    @State var emojis = ["🐠", "🐢", "🦋", "🐥", "🐣", "🐰", "🐝", "🦄", "🐵", "🐛"]

This second problem is because I couldn’t just

Jul. 7, 2022

CS193p

I’ve loved the first couple of these “Getting Started with SwiftUI” lectures from Paul Hegarty at Stanford. He’s put a lot of thought into the sequence, and seems to address the questions that float up in my mind (with super clear explanations) just as I’m thinking of them. They also generously make the reading and homework assignments available at cs193p.sites.stanford.edu so it’s possible to treat it as a course which I have made a bit of a start on, before being distracted by building my own simple app.