-
.onAppear() and fatalError()
See Paul https://www.hackingwithswift.com/books/ios-swiftui/running-code-when-our-app-launches
-
Watching for Change
"When working with structs, the @State property wrapper keeps a value alive and also watches it for changes. On the other hand, when working with classes, @State is just there for keeping object alive – all the watching for changes and updating the view…
-
Animated again and again
to add animation to some view when it changes, add .animation(.default, value: someVariable). This will apply the .default animation as an implicit animation, whenever the value of that variable changes. Alternatively, you can add the .animation()…
-
get location
https://www.hackingwithswift.com/read/22/2/requesting-location-core-location https://medium.com/@nayananp/user-location-in-swift-with-cllocationmanager-4a447311d7d8
-
location auth status
https://stackoverflow.com/questions/64073811/authorizationstatus-for-cllocationmanager-is-deprecated-on-ios-14 https://developer.apple.com/documentation/corelocation/cllocationmanager/3563952-authorizationstatus https://developer.apple.com/documentation/c…
-
distance between locations
https://www.ralfebert.com/swift/cllocationcoordinate2d-distance/
-
Fading away
Have some sort of transition, maybe fade in/out, when we change days and pins move.
-
MapBox
Not today, but sometime it’d be fun to take a look at the sample MapBox iOS app on GitHub.
-
If they release a new feature for the OS, then get that included in your app and submit it for "featured" app status a good few weeks before that new iOS is released.
-
Shaking the Tree
One day, I want to scan through my app's source code, and remove any functions (or anything else) that aren't actually used. The best way I know of to do this is to use Periphery. There are likely others, but this seems like a good, robust, actively…
-
Biscuits
I found some biscuits that I didn't know I had. They are yum. Winning.
-
Today and Tomorrow
I’m going to want to label my map pins as Today and Tomorrow where appropriate, then Sunday, Monday etc for the remaining days. To do that, I’ll want to look at this post.
-
Smooth As
I really want to try AnyLayout to make the VStack to HStack transition butter-smooth.
-
Make two things the same size
To make two (or more) objects the same height in SwiftUI, just make them all .frame(maxHeight: .infinity) and then make the container they're in .fixedSize(horizontal: false, vertical: true). In this instance, '.fixedSize()' really means 'minimum size'.…
-
MapKit Tutorial Videos
Stewart Lynch has made a YouTube playlist of MapKit tutorial videos.
-
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().