Content-Creation


Sep. 23, 2022

Gists for embedding code

So, I might have found a slightly better method for sharing code in posts that I complained about the other day . GitHub has a thing called Gists . It’s like a tiny repository you can paste a code snippet into (or upload a source file). Once that’s done, you can just paste the URL of the Gist into Wordpress - it recognises it and does this:

ForEach(0..<3) { number in
    Button {
       // flag was tapped
       flagTapped(number)
       } label: {
           FlagView(flagOf: countries[number])
       }
       .rotation3DEffect(.degrees(flagSpinAmount[number]),
            axis: (x: 0, y: 1, z: 0))
       .opacity(flagOpacity[number])
       .scaleEffect(flagScale[number])
       .animation(.default, value: flagSpinAmount)
}

I came across this being used on a blog post (about using the camera in apps) from Gaspard Rosay .

Aug. 23, 2022

Sometimes the Gold is in the Comments

I’m still not 100% clear on @ObservedObject v @StateObject. So when YouTube offered up this video, in which Paul promises during the intro that I’ll understand the data bindings by the end, I thought it would be the video for me.

I guess I should really have twigged that I’d never heard of @ObjectBinding, but I pushed on to the 12 minute mark when he imports the Combine framework. Hang on, what’s that?