@donnywals@chaos.social
@donnywals@chaos.social avatar

donnywals

@donnywals@chaos.social

iOS Engineer, blogger, and author at http://donnywals.com. Loves learning and sharing knowledge. ❤ Dorien -- #swift #ios #swiftlang #iosdev (he/him)

This profile is from a federated server and may be incomplete. Browse more on the original instance.

donnywals, to random
@donnywals@chaos.social avatar

A good morning and happy Monday folks! Hope you had a nice weekend!

What are your plans for this week? Working on something cool? Learning something new? Anything at all, tell me about it 😄

donnywals, to random
@donnywals@chaos.social avatar

And we're live! My Privacy Generator tool is now available at https://www.privacymanifest.dev/

It will help you add all kinds of privacy manifest data to your project. The manifest updates in real time so you can immediately see the result of your actions

Copy the new manifest to your clipboard or download it so you can add it directly to Xcode.

donnywals,
@donnywals@chaos.social avatar

@ctietze can't believe it tool me two whole days to build this and then a third to get it deployed! Slowest dev ever 😜

donnywals, to random
@donnywals@chaos.social avatar

I think I'm pretty happy with how this is shaping up for now. Today I'll get it deployed so y'all can give it a spin!

donnywals, to random
@donnywals@chaos.social avatar

Going back to the gym is probably the best thing I’ve done for my mental health in a long time. I’ve been going twice a week for about a month now and the difference in how I feel is huge. 10/10 would recommend

donnywals, to random
@donnywals@chaos.social avatar

I really hope that if Apple adds some kind of AI components to Xcode, iOS, the Mac or any other piece of their ecosystem it’s:

  • not US only
  • supports more than just English and a handful of other languages

Would be amazing to not have instant disappointment over an exiting feature that won’t make it to NL for years…

donnywals, to random
@donnywals@chaos.social avatar

Out of the box, SwiftUI’s TextField and other components don’t allow you to bind to an Optional model value.

In this post I explain how you can write an extension on Binding provide default values for optional values so that you can bind to them.

https://www.donnywals.com/providing-a-default-value-for-a-swiftui-binding/

donnywals, to random
@donnywals@chaos.social avatar

Do you know how to use TaskGroups in Swift? I just applied some minor updates to my blog post that explains exactly how and when you should be using TaskGroups in your project 👍

https://www.donnywals.com/swift-concurrencys-taskgroup-explained/

donnywals, to random
@donnywals@chaos.social avatar

🚨 New video is live! This one is the companion for my actor reentrancy post from last week 😱

https://youtu.be/NSMvwjO7Ono

donnywals, to random
@donnywals@chaos.social avatar

Good morning and a happy Monday folks! Hope you’ve all had a nice weekend.

What are your plans for this week? Are you working on something cool? Learning something new? Tell me all about it! 😎

donnywals, to random
@donnywals@chaos.social avatar

We’ve had macros for almost a year now and I’m wondering:

  • have you written any macros?
  • are you actively using macros in your projects? (And are they the ones Apple ships or custom ones)
donnywals, to random
@donnywals@chaos.social avatar

Actors in Swift help us make sure our code is free of data races. They can do this by promising us that they only do one thing at a time. That way, we can safely read and write mutable state without running into data races.

That said.. when a function call on an actor gets suspended because it's awaiting something, the actor will happily start running a second function.

donnywals,
@donnywals@chaos.social avatar

This is called actor reentrancy and in this week's post I explain exactly what reentrancy is, why it can be a problem, and I show you one of several ways that you can fix a reentrancy related problem.

https://www.donnywals.com/actor-reentrancy-in-swift-explained/

donnywals,
@donnywals@chaos.social avatar

@mattiem It's such a rabbit hole tbh!

donnywals, to random
@donnywals@chaos.social avatar

A new week has started! Happy Monday 😁

Do you have any plans for this week? Like learning something new, working on something cool, anything at all? Tell me all about it 😎

My week is all about my Concurrency video course, recording and planning some new YouTube videos and hosting a SwiftUI workshop on Wednesday. A busy and exciting week ahead!

If you're interested in expanding and deepening your knowledge of SwiftUI check out the workshop here: https://www.eventbrite.nl/e/mastering-swiftui-data-flow-march-2024-tickets-791084483987

donnywals, to random
@donnywals@chaos.social avatar

Yay! App is approved and live on the App Store.

It’s a pretty simple app that uses AI to suggest fun and educational activities for babies and toddlers.

It’s a typical scratch your own itch project; coming up with fun newborn activities is hard but this app gives some fun ideas

If you have kids; you might want to give it a go: https://apps.apple.com/nl/app/tinysteps-activities/id6479526610

No subs or in app purchases. Just a single purchase.

donnywals, to random
@donnywals@chaos.social avatar

If you're flying folks out to come speak at your conference the least you should do is pay for their expenses. It always amazes me to hear that speakers are expected to fly out to some conferences completely on their own dime...

Without speakers there's no event. So the bare minimum you can do is make sure they can be at the conference in order to make the event happen.

donnywals, to random
@donnywals@chaos.social avatar

Due to a mistake in my testing setup, I included a mistake in my article on async functions.

The mistake is I wrote that if we have a non-async function that spawns a Task, we depend on the callsite's actor isolation to determine whether the new Task runs on the main actor.

Turns out that's not the case. I observed that the spawned Task is never main actor isolated even when callsite is.

I assume that that's because there's no actor isolation applied to the function.

https://www.donnywals.com/how-to-determine-where-tasks-and-async-functions-run-in-swift/

donnywals,
@donnywals@chaos.social avatar

@mattiem Right, the nonisolated async function thing I already had in there.

It's the nonisolated non-async function always spawning Tasks in the background that got me. I'm still a little surprised about that one to be honest but the observation is consistent.

donnywals,
@donnywals@chaos.social avatar

@mattiem agreed. Being on the main thread but not isolated to the main actor per se is mind bending basically

donnywals,
@donnywals@chaos.social avatar

@leogdion @mattiem you’re not supposed to have to check this since you’d be able to figure this out at compile time. I get the desire to want to check it but you shouldn’t have to

donnywals, to random
@donnywals@chaos.social avatar

This is one of the most popular posts on my blog right now: https://www.donnywals.com/what-is-escaping-in-swift/

In an effort to make sure it's not just one of the most popular but also one of the best; what do you think I should do to improve this post?

mattiem, to random
@mattiem@mastodon.social avatar

@donnywals hey Donny!

I just read your post here. I’m not sure using a runtime check (Thread.isMainThread) really makes sense here because isolation is determined at compile time. There is never ambiguity for correctly annotated APIs.

Though I do agree that SwiftUI marking its body as MainActor but not the entire type is a poor API that makes it specifically hard to use.

https://www.donnywals.com/how-to-determine-where-tasks-and-async-functions-run-in-swift/

donnywals,
@donnywals@chaos.social avatar

@mattiem in lots of cases you won’t need it if you understand the rules. That said, I did see that in case you call a function that spawns a task it matters where you call the function from.

Also, as a learning I think runtime checks can help solidify your understanding of the rules

donnywals,
@donnywals@chaos.social avatar
donnywals, to random
@donnywals@chaos.social avatar

A very good morning and a happy Monday, folks! Did you all have a nice weekend? I sure did 😁

What are your plans for this week? Are you working on something cool? Learning anything new? Shipping something? Tell me all about it 😎

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • kavyap
  • DreamBathrooms
  • osvaldo12
  • magazineikmin
  • InstantRegret
  • everett
  • Youngstown
  • ngwrru68w68
  • slotface
  • rosin
  • GTA5RPClips
  • tester
  • PowerRangers
  • anitta
  • thenastyranch
  • mdbf
  • ethstaker
  • cisconetworking
  • Durango
  • vwfavf
  • normalnudes
  • tacticalgear
  • khanakhh
  • modclub
  • cubers
  • Leos
  • megavids
  • All magazines