-
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.
-
.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.
-
Getting Apps "Featured"
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…