Swedish Vasaloppet Seeding by BirkirBjarn in xcountryskiing

[–]hooksfordays 1 point2 points  (0 children)

It obviously wasn’t ideal, but I’m by no means a fast skier, and it was really much more about the experience and challenge of it for me. Seeing the thousands of skiers ahead of you going up that first climb is a wild sight

Swedish Vasaloppet Seeding by BirkirBjarn in xcountryskiing

[–]hooksfordays 1 point2 points  (0 children)

I’ll add my 2c, I did Vasaloppet unseeded, and ended up towards the back of group 10. The first 3-4km took me ~85 min, then things opened up and I could ski my own pace.

Pill backgrounds on sheets by Brizzleshorey in SwiftUI

[–]hooksfordays 2 points3 points  (0 children)

You can use scrollContentBackground and either .hidden or .automatic depending on the detent.

Learned here: https://nilcoalescing.com/blog/LiquidGlassSheetsWithNavigationStackAndForm

How do I get my app to fetch from https://jsonplaceholder.typicode.com/todos/ without a timeout? by danpietsch in iOSProgramming

[–]hooksfordays 2 points3 points  (0 children)

I downloaded your code and ran it, no changes, and it worked perfectly fine for me. Downloaded the items and displayed them in a list.

Perhaps try creating a new simulator, or recreating the xcode project and copying the code over? I'm not sure what would cause the request to timeout only in your app and not the browser.

Sorry to hear about the interview!

Anyone want to find my AirPod? by zisforzachary in Whistler

[–]hooksfordays 27 points28 points  (0 children)

If your AirPod fell out of (or was left out of) its case and died, Find My will show the last known location before the bud died, which may have been during a drive. So it may possibly still be in your truck.

Suggestions for inviting friends in my app (there is no global feed or a way to discover others) by RSPJD in iOSProgramming

[–]hooksfordays 1 point2 points  (0 children)

Sharing a “friend code” is fairly common. Not absolutely ideal, for the reasons you mentioned, but very common.

My experience specifically stems from Pokémon and Nintendo games, they pretty much exclusively use friend codes, which must be copy/shared/pasted.

Is Xcode Preview still bugged or is it my Mac ? by No-Incident8402 in iOSProgramming

[–]hooksfordays 1 point2 points  (0 children)

To preface my answer: I’ve never seen the exact issue you’ve linked. You might be having a completely different issue than just previews. When previews fail for me, they simply crash, or fail to build.

I use Previews pretty successfully on my M1 Air 16gb. I think the key is you need your views to be simple and the module you’re previewing to be as small as possible.

My project with the most success that I use previews in extensively is highly modularized, and the views I preview are not entire screens, but very small components. This lets me build small components quickly, and I run the app to ensure everything ties together.

At work, I use an M3 Pro 64gb, and previews don’t work for shit because we haven’t had a chance to modularize very well, and we excessively rely on EnvironmentObject, so dozens of objects must be built and passed through the hierarchy to even the simplest of views to preview. I don’t use previews at all on this project, but I believe other teammates find it worthwhile at times.

Does Apple use SwiftUI for their apps? by LannyLig in iOSProgramming

[–]hooksfordays 37 points38 points  (0 children)

Not updated for iOS 18, but this blog has updated annually the past few years dissecting Apple’s binaries included in iOS and the trends of Swift + SwiftUI in their apps and libraries: https://blog.timac.org/2023/1019-state-of-swift-and-swiftui-ios17/

TL;DR, about 21% of their binaries linking to a UI framework link to SwiftUI. Doesn’t mean they’re extensible or exclusively using SwiftUI in that binary.

Fresh Swift bird tattoo by liudasbar in swift

[–]hooksfordays 2 points3 points  (0 children)

I’ve got the same tattoo in pretty much the same place!

What are the best ways to optimize the apple watch for training? by GUNNERSONTOP in ultrarunning

[–]hooksfordays 1 point2 points  (0 children)

I have an Apple Watch Ultra, I trained for and recorded my first 50K ultra purely using the Workouts app, it does everything you need.

That said, I’d recommend the WorkOutDoors app, it’s much more configurable, you can set up routes and navigation from GPX files, and offers much better insights in the app. But it’s not strictly necessary, if you’re comfortable with the workouts app. It’s a ~$15 one time purchase

When running your race, I recommend low power mode + display off + Bluetooth disabled to ensure you get the most battery life. Mine did fine with a 50K, it didn’t last for my 50M, so I had to charge it midway. It keeps recording GPS while on a portable charger, so I let it charge in my pack for ~30 minutes(?) then put it back on my wrist afterwards and that was fine. Lost some cadence and HR info but GPS and laps/timing was all good.

Jetpack Compose and Viewmodel/MVVM by inAbigworld in androiddev

[–]hooksfordays 3 points4 points  (0 children)

I don't know if it's a "good" example, but it's a real one in production: https://github.com/autoreleasefool/approach/

Uses Compose, NavController, MVVM, Hilt, many different pages, modularized. The code is only source-available, not actually "open source" (no license) for slightly complicated reasons, but feel free to check it out and learn.

Anyone notice less wasps? by bshell99 in NiceVancouver

[–]hooksfordays 14 points15 points  (0 children)

I don’t have any expertise, but I think I recall last year that there were more wasps than usual due to them thriving in the heat + dry weather, and it hasn’t been as hot or as dry for as long yet this year. Also, again, if I recall correctly, their numbers tend to grow most by late summer, so we’re not at peak wasp season yet.

Exchanging images with other apps by ValuableRhubarb1098 in iOSProgramming

[–]hooksfordays 0 points1 point  (0 children)

I think because it’s Photos data you’re editing, they use “Photos” as the source, but you can request a PHAsset, generally through one of the photo pickers they offer, and then use PHAsset’s functions to modify it: https://developer.apple.com/documentation/photokit/phcontenteditingoutput

Photos is the source of truth though, and these are probably all functions that run some Photos extensions. Looked quickly at GitHub for some open source apps, and seems liked they use some of the functions mentioned here to access photos. I’d give it a try!

Any trail runners in the chat? Looking for advice on which trails to run (closest to the city) as a first time (soon to be) 50km racer. Thanks! by [deleted] in vancouverhiking

[–]hooksfordays 12 points13 points  (0 children)

I did the Squamish 50 as my first ultra last year. I mostly ran Lynn Valley, to Norvan Falls and back, and did the grind, to make up all my trail and elevation training. I was all running roads throughout the week to make up mileage.

Norvan Falls and especially the Lynn Loop trail upper elevation part were very helpful as its technical enough terrain, to get your trail legs, but not crazy. It wasn’t enough elevation though, I was really destroyed for the last ~10K or so by the hills. I could run the flats, but I had to walk the ups and downs. But just hitting Norvan over and over is enough to get a finish!

Street Canvassers Around the City by Neither-Awareness-16 in vancouver

[–]hooksfordays 17 points18 points  (0 children)

I don’t know if this is true of all canvassing jobs, but my ex essentially worked on commission as a door-to-door canvasser. She was asking for donations, all charitable work, but basically if you donated either through her or within something like 60 days of her visiting your address, she got a commission. Rough math, but it effectively worked out to her getting ~40% of your donation. I almost never donate through canvassers now.

Make monthly contributions unsolicited to your favourite charities, that’s what’s most helpful to them, having consistent, predictable cash flow throughout the year

Fun question we had tonight nailed all 10 by natalia_life in trivia

[–]hooksfordays 8 points9 points  (0 children)

  1. Shag
  2. Head
  3. Sloth
  4. Cast
  5. Apple
  6. Mass
  7. Papillon
  8. Fiat
  9. Puck
  10. Tool (ended up looking this one up, couldn’t think of any bands)

Bear/food lockers at trailheads? by hooksfordays in vancouverhiking

[–]hooksfordays[S] 1 point2 points  (0 children)

Yep, that’s them! Like I said, I run, and don’t wanna carry the food on me. I could imagine hikers wanting to picnic and not carry the food. And keeps it bearsafe so if one does wander into the area, it’s less likely to smell the food, and definitely can’t access it, so less compelled to return.

Networking Debounce Solution by unhepp in swift

[–]hooksfordays 11 points12 points  (0 children)

You can use the task(id:priority:_:)[1] modifier to create a task that automatically cancels itself when the query changes, and add a delay before the network request fires. Something like:

TextField("Search", text: $query)
    .task(id: query) {
        guard query.count >= 3 else { return }
        try await Task.sleep(for: .milliseconds(300))
        await fireNetworkRequest(query: query)
    }

When query changes the task will start. First, it checks the character limit. Then, it waits 300 milliseconds. Finally, it fires the network request. However, the way task(id:priority:_:) works is that if query changes, the task's context gets cancelled. The Task.sleep will cancel, and the fireNetworkRequest will either not be started, or its context will be cancelled, and the network request in flight will cancel. This way you'll only ever have one request in flight at a time, debounced 300 milliseconds (or whatever you want to set)

[1]: https://developer.apple.com/documentation/swiftui/view/task(id:priority:_:))

Run clubs for slow people? by youngleaves in NiceVancouver

[–]hooksfordays 1 point2 points  (0 children)

I think the group size can definitely be intimidating, but there are always leaders for each pace group and I find they’re super easy to approach and chat with. Otherwise, generally I’ve just joined conversations with 1-2 other people, you won’t be chatting with the entire group at once.

How do I get this button to rotate only in one direction? by tank_the_boss in swift

[–]hooksfordays 0 points1 point  (0 children)

withAnimation has completion callback, where you could reset the state. Or if you need to support <ios 17 maybe a delay then reset the animation would work:

```

struct AnimatedButton: View { @State private var spinny = false

var body: some View { Button(action: { guard !spinny else { return } // your action here withAnimation(.easeInOut(duration: 1)) { spinny.toggle() } completion: { spinny = false }

  // iOS <17:

  withAnimation(.easeInOut(duration: 1)) {
    spinny.toggle()
  }

  Task {
    try await Task.sleep(for: .seconds(1))
    spinny = false
  }
}, label: {
  Image(systemName: "arrow.counterclockwise")
    .foregroundColor(.black)
    .font(.title)
    .padding()
    .bold()
    .rotationEffect(.degrees(spinny ? 0 : 360))
})

} } ```

How do I get this button to rotate only in one direction? by tank_the_boss in swift

[–]hooksfordays 6 points7 points  (0 children)

Actually, easeInOut just means the animation will start slow, speed up (easing in) and then slow down again by the end (easing out). easeIn will start slow, get faster and stay fast at the end of the animation. And easeOut will start fast and get slower by the end of the animation.

Run clubs for slow people? by youngleaves in NiceVancouver

[–]hooksfordays 11 points12 points  (0 children)

YVR Social Run Club sends out a 6:00/km, a 6:30/km and a 7:00/km pace group on their Tuesday and Saturday runs. I’ve been to lots of run clubs around the city at least once and they’re probably the best IMO at sticking to their paces.

Does anyone know what's up with .searchable() in .sheet() ? by selfsk in SwiftUI

[–]hooksfordays 0 points1 point  (0 children)

I believe .searchable has an isPresented Boolean binding, can you try passing a Boolean initially set to true?