-
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.
-
.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…