Tag: code
-
FriendFace Feedback
After each app, I use my HackingWithSwift+ membership to view Paul’s version of the app as a way to judge my performance. Yesterday’s app was “FriendFace” – download some JSON of a number of people (including their friends) and display it. UUID In my struct, I’d just specified the User.id as a string, Paul uses…
-
FriendFace
The Day 60 Milestone is a demo app that vacuums up some JSON and displays it in a list in a NavigationView that links to a details page. Nothing super strenuous, the steps were something like this: 1) Download the JSON and have a look at the structure. Firefox has a simple JSON viewer built…
-
Project 12 Challenges
Project 12 was a series of code tutorials around developing CoreData concepts rather than a real app, but the challenges are based on a very small app that uses a subview to allow dynamic (ie changeable at runtime) filtering of a list of data. The reason this would be tricky is that the @FetchRequest is…
-
Bookworm Challenges
Another set of challenges for a #100DaysofSwiftUI tutorial app. Project 11 was a book tracking app – the big new thing was using CoreData. Here’s the challenges for it. Right now it’s possible to select no title, author, or genre for books, which causes a problem for the detail view. Please fix this, either by…
-
@Binding – data between views
In C world, if we want to pass a parameter down into a functional call, and allow the receiving function to change it’s value, we’d pass a pointer to the variable. Something like this: For youngsters, what’s happening is that we’ve set the value of a to 5, then passed the memory address of a…
-
Codable & JSON
If we mark a type with the protocol Codable, we’re specifying that this type has the capability of having it’s properties encoded to some format, and decoded back again. So far in the #100Days this has been used to write and read data in UserDefaults, and to encode an object to send it as a…
-
Day 47 – Habits App
I’ve been mucking around with the Habits app too long – it’s started to look like procrastination. It already meets the specification, so I’m calling it an MVP and moving on. This is the first app of mine I’ve loaded onto my phone and started using, and there are a couple of things I’d like…
-
Updating stored JSON due to a struct change
I mentioned yesterday “I could use a renamed old version of my struct to load the existing data, and convert it across to the new model.“. Since I’ve been testing the app on my phone, and using plausible data, it was going to be painful enough to lose it that I thought I should go…
-
JSON encode/decode
As usual, I’m spending way more time on the apps written from scratch in the 100Days series. The Habit tracking app I’m working on has been good practice, especially of the architecture of the simple list based app. My version has a couple of refinements I quite like. I’m using a checkmark in a rectangle…
-
Refreshing SwiftUI Views
SwiftUI does some property wrapper magic to (very efficiently) refresh your views, but what if you want to force a refresh for some reason? Here’s the techniques I’m currently using to do that. The tricks are below, but just so you can see them in context, here’s the sample app we’re working on. It’s a…