Category: XCode14
-
Sharing is caring
Continuing on with the demo project from yesterday, in which we used the ImageRenderer class to turn a view into an image, today we want to let the user share it somehow. Typically, apps have a button using the square.and.arrow.up SF Symbol to share something from the current screen. It’s probably not an accident that…
-
Console spam – No wall clock alignment
When I was working on the Day 60 app, I noticed I kept getting a message in the console “No wall clock alignment provided at SwiftUI/ResolvableStringAttribute.swift:86” every time I went into the detail view. Via elimination by commenting bits out, I’ve narrowed it down to a date formatting call. Here is the code to reproduce…
-
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 Feedback
I did so well on this one that it’s not going to make a very interesting post. My first two challenge solutions were pretty much character for character the same – so not much to report. On the third challenge, there was a minor difference in the display process. I had done this: But @twostraws…
-
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…
-
CoreData and the Preview
I’ve noticed Paul is inclined to ignore the preview and run his code in the simulator to check its operation. That’s valid, but it seems quicker, and reassuring, to see it in the preview as I type. This led to a small problem with Day 53 that uses CoreData. When I added a student in…
-
Cupcake Corner Feedback
As usual, here’s my thoughts comparing my attempts at the challenges to Paul’s. Usually he’s better! 1) Whitespace The task was to validate the order address properties, not just by checking they are not empty, but also that they don’t just contain spaces. I went the bruteforce route since there was no .isEmptyIncludingWhitespace method. As…
-
Cupcake Corner challenges
Day 52 of #100Days was the challenges to the Cupcake Corner app – an app that allows you to build a one-row order, encode it as JSON and submit it to an API with a URLSession. To allow the order to be passed around, it’s an @ObservedObject which meant that a few extra hoops needed…
-
Day 50 – @State vs @Observed again
Way back when, I was unclear about @StateObject and @ObservedObject (here, and here). I still am. But in today’s tutorial video, Paul clearly says that the @StateObject is for the single place in your app where the object is created, then everywhere else, use @ObservedObject. Trouble is, I just know from the Simple MVVM app…