-
Chloe’s Laws of SwiftUI
Chloe has written an Opinionated and Biased Law of SwiftUI and I think it's worth a read
-
iOS Navigation Patterns
An outline of Modern iOS Navigation Patterns
-
MeasurementFormatter
When displaying distance (or length) to the user, you want MeasurementFormatter.
-
Link to Any Text
If you want to have a URL that links to any text on a page, even if there is no anchor at that point, then check this page about Scroll to Text Fragment Instead of linking to a regular anchor like #my_anchor, you add #:~:text=some%20text. So for example…
-
Magic Replace
For some pairs of SF symbols, you can replace one with another using a "magic" transition. See Natalia Panferova's how-to for more, or the demo on Apple's doco page.
-
Parsing Dates Without Times
From everyone’s favourite Eskimo … https://developer.apple.com/forums/thread/655000 tl;dr - just save the separate bits.
-
Cues
Some time, I want to understand the docs for MagicQ well enough to copy the fixtures for my local comunity theatre, out of MagicQ and in to QLC+.
-
Example Structs
When making a 'Struct', particularly if it's to be used with SwiftUI, it's a good idea to add an example. static let example = Location(id: UUID(), name: "Buckingham Palace", latitude: 51.501, longitude: -0.141) This is particularly helpful for Previews.
-
SVG Editor
Maybe try SVG-Edit
-
Fun on the menu
Might be fun to try the Ice menu bar app.
-
My web logfiles
Web logs are in ~/.config/valet/Log config files are at ~/.config/valet/Nginx
-
SwiftUI Navigation
An interesting thread on SwiftUI Navigation https://hachyderm.io/@teissler/112476974255668785
-
SF Symbols - but safer
Go get SF Safe Symbols.
-
@Bindable vs @Binding
Use @Bindable to access a shared instance of a Class (that's @Observable). Use @Binding to access a shared simple value, ie a Boolean or Double or array etc (which can't be @Observable). Note - in both cases, the original thing is created with @State.
-
get text from URL
A super-basic way to get plain text from a URL is: struct ContentView: View { @State private var mytext = "loading..." func loadData() async { do { let url = URL(string: "https://thespia.com/test/")! mytext = try…
-
Swift code to learn from
There's a dev called Mahdi Bchatnia who made Autoclick (as well as a bunch of other interesting apps). And he (she? they?) have kindly made a bunch of useful code available on Github for our learning pleasure.
-
The Double Diamond
Discover, Define, Develop, Deliver Read about it here or learn more here.
-
Sharing @Observables through the environment
First, you want an Observable class. @Observable class Player { var name = "Anonymous" var highScore = 0 } In your top-level View, you want a @State var and you want to stick it in the subviews via enviornment(), thus: struct ContentView: View { …
-
Safari but cleaner
I haven't tried it yet, but the StopTheMadness Safari extension (for iPhone and also Mac) looks like it removes a bunch of enshittification that web devs (or web devs' corporate overlords) like to put on "modern" websites. It's not cheap ($23 AUD) but it…
-
A Font of Beauty
Robert Green’s facsimile of the Doves Press typeface is lovely. It's not free but it's worth it. There's one version of the font for regular size text, and a slightly tweaked "Headline" version for larger text. Either (or both) can be bought here.