Tag: code

  • Animating Guess The Flag

    The challenges for Project 6 of 100 Days of SwiftUI was to add some animations to the Guess the Flag app from a little while ago. The animations themselves were not particularly tricky, my main issue was that I was creating the views for the three flags in a ForEach, so the animations were applied…

  • Animations in Views

    It’s a very Apple-thinking thing to be learning about making beautiful and intuitive user experiences this early in a programing tutorial as I am with the 100 Days of Swift UI series. Here’s a quick look at three different ways of doing animation in SwiftUI Views. Implicit animation An implicit animation in SwiftUI is when…

  • Word Scramble Feedback

    As is my practice now, after completing the challenges for Project 5, I reviewed Paul’s solution (which is only available to subscribers) to see what he’d done better so I could learn from it. Most of the differences where not of much significance, but there was a couple of things I picked up: When the…

  • Project 5 – Word Scramble

    Another 100 Days of Swift UI project wrapped up – this time a scrabble like word game. New techniques included saving a large text file in the app bundle and loading it (via a string) into an array on launch of the view. Also a short adventure into UIKit to use a UITextChecker. Source.

  • Project 4 Challenges

    I’ve completed the Project 4 challenges (source) of the 100 Days of SwiftUI, no biggie – the increase in difficulty between each step of Paul’s bootcamp is small enough that it’s never too stressful, but large enough you feel like you’re progressing all the time. Since I’ve paid to be a member of Hacking with…

  • Rock, Paper, Scissors (1)

    As I mentioned yesterday, I needed to make some progress to blog about, and I had a half working version of a Rock, Paper, Scissors for Day 25 so I pushed myself to get that working. There’s lots in the code below I don’t love. source on github

  • .self in ForEach

    I’m on Day 25 of Hacking With SwiftUI, and Paul is making a point about how SwiftUI can loop over an array to build a view. He starts with this: But then proposes an alternative: He explains the use of \.self here by saying So, we come back to how Swift can identify values in…

  • Project 3

    This one’s not really a project, just a couple of little updates to earlier work, and a code snippet. Challenge 1 Go back to project 1 and use a conditional modifier to change the total amount text view to red if the user selects a 0% tip. The first one is pretty simple – a…

  • Day 23 – Views and Modifiers – Part 4

    Then the last trick for for decomposing the views, is to remember we can pass values when we init a struct. So something like this: This is probably my favourite – because although in this example I’ve created the mini-view struct in the body, if it’s a building block I can use elsewhere in a…

  • Day 23 – Views and Modifiers – Part 3

    The next part of day 23 started to make my brain hurt a bit. It’s easy to imagine that when presenting a complex screen – perhaps some data from a source as a mixture of images and text loaded from a database into a scroll-able view, that the view may start to get complex. Then…