-
Landscape vs Portrait
This post shows how to tell if you're landscape or portrat. GeometryReader { geometry in if geometry.size.height > geometry.size.width { print("portrait") } else { print("landscape") } But Apple suggests that you…
-
Internationalisation / Localisation / Translation
If I'm doing it all myself (or managing translations via chat or Discord or something), then I just need TranslateKit. If I want to crowd-source the translations, and/or allow folks to do it themselves in their own time on a separate system, I could…
-
Brother, I need a printer.
Need a new printer, in 2024? Maybe have a read of this.
-
@Observable
Might need to make my state class @Observable. As always, Paul has my back.
-
Swift fatalError()
To trigger a fatal error, you want Paul's guide to fatalError().
-
async button
Mahid has an interesting idea for an async button. struct AsyncButton<Label: View>: View { let action: () async -> Void let label: Label @State private var isRunning = false init( action: @escaping () async -> Void, …
-
Rock pools
... and other lovely swimming spots. The folks at Kids in Adelaide have put together a list.
-
Game Tile Image Assets
... for free! :) From Kenney.
-
Testing Network Code in Swift
As with most Swift / SwiftUI questions, the answer is to see what Paul has written about it.
-
One Target, One Scheme, Two Build Configs
Rather than having two separate Targets and two separate Schemes, maybe just have one of each. We can get different Info.plist values by having one Custom iOS Target Property set to a Build Setting, and then have two values for that Build Setting. One for…
-
Clear UserDefaults
To clear all UserDefaults from an app, maybe try this: if let appDomain = Bundle.main.bundleIdentifier { UserDefaults.standard.removePersistentDomain(forName: appDomain) } Thanks to Sourabh Sharma for this idea. Or maybe…
-
Lucky
I am very fortunate in my work. I'm paid a decent amount, to do work that is (mostly) quite interesting, with people who are good to work with. That said, I'd rather be building my Lego Great Wave.
-
Async/Await - DJIA
To get the DJIA open in the background, take a look at this post or this one, or maybe just go straight to Paul's overview.
-
Dynamic Wallpaper
To make dynamic wallpaper, which changes for dark mode vs light mode, I generally use Wallpapper.
-
To @State or not to @State…
To understand @State and all the other SwiftUI property wrappers, maybe take a look at Paul’s outline. Clear and simple, with just enough info to be useful but not enough to confuse.
-
iOS App Icons
Nice and simple ... from makeappicon.com or (perhaps better) appiconmaker.co.
-
Nice looking map markers
tl;dr - read this post With a SF Symbol it's Marker("Tues", systemImage: "4.alt.circle", coordinate: .marker) With a one-to-three character monogram, it's Marker("Tues", monogram: "+2", coordinate: .marker) You can also use a Swiftui Label, though I can't…
-
Transitions 101
First, when updating the @State variable, wrap in withAnimation{} Then, add a .transition(.move(edge: .bottom)) (or whatever transition you want) to the View you are targetting tl;dr - look at Paul's post.
-
UX fun - Draggable GratInfo?
Do I want to make the GratInfo area draggable?
-
UX changes
Current / Retro picker - horizontal padding Date section - same height for Current and Retro Horizontal lines are missing, north of the equator Landscape on small phone - put gratinfo section to the right of the map section Add < and > buttons to the…