Profile avatar
eidhof.nl
48 posts 553 followers 95 following
Regular Contributor
Active Commenter

I thought I'd found a bug in SwiftUI, but it turned out to just be an unlucky combination of implementation details: chris.eidhof.nl/post/swiftui...

Swift Talk 443 Staggered Animations Revisited After a two year hiatus, we build a staggered modifier in SwiftUI that works with any view in the view tree. This episode is free to watch! 😊 talk.objc.io/episodes/S01...

The store didn’t have my usual shampoo. Got a different brand with a different fragrance and now I keep thinking there’s a person standing right next to me because I’m not yet used to the new smell. 🙃

Went to a miso-making workshop today, where we made miso paste and onigiri, so much fun (and so delicious). The only difficult bit left is waiting for half a year until the miso paste is ready with fermentation...

Coming Feb. 5–6 to Apple Developer Center Cupertino and on livestream, Bring SwiftUI to your app! We’ll focus on how your expertise in imperative user interface frameworks like UIKit and AppKit can help you get comfortable with SwiftUI’s declarative approach.

No video today because I’ve got to watch the kids all day. Will be back at it on Monday!

The `Animatable` protocol lets you hook into the animation subsystem of SwiftUI. You can expose any property using `AnimatableData` and have it interpolated for you (but the property does need to conform to `VectorArithmetic`)

Keyframe animations are a very powerful tool to have in your toolbox. They're more complicated than regular SwiftUI animations but allow you to animate almost anything you can think of.

Phase animators can help to work around the limitations of the regular SwiftUI animation system. They let you do animations that end up in the same state as the starting point.

In many cases, adding a `.animation` or `withAnimation` might be all you need to have beautiful interruptible animations in SwiftUI.

I've spent the 6 months working on a new approach to shared data in Swift: Forked. Main features: - Git-like branching and merging for Swift structs - Advanced merge algorithms (CRDTs) - Macros to make structs mergeable - Sync structs via CloudKit with <10 LOCs appdecentral.com/2024/12/13/n...

Today we recap a bunch of things we looked at in the last two weeks of short videos. It was a bit of a struggle to get this in at under one minute but I managed 😅

Often it doesn't really matter whether you use an overlay or a ZStack, but if the views have different sizes and positions, it definitely does!

Explicit alignment guides are very helpful when aligning using two different alignment guides. In this example, we align the center of a badge to the top trailing edge of a button.

First text baseline alignment is a great way to align views horizontally that contain different font sizes. SF Symbols even have builtin support for this.

In our workshops we often notice that view alignment is underused. This week's short videos will mostly look at working with alignment. This video shows aligning stacks, frames and overlays. Here's the corresponding SwiftUI Field Guide page: www.swiftuifieldguide.com/layout/align...

Managed to wrap GraphViz to lay out a DAG. All the drawing itself is SwiftUI. This still calls out to the binary (which you need to have installed). Would be nice to wrap the GraphViz C library as a Swift Package so I can ship this in our workshop app.

One of the must underrated views in SwiftUI might just be the `Text` view. It's a perfect example of progressive disclosure: once you dig in, you'll find a bunch of nice features! Related to the video: developer.apple.com/documentatio...

For our workshop (Mac) app, we have a lot of branches (one per client). I kinda would like to setup CI so that it automatically builds the app, runs it on the most recent + 1 version back of macOS (smoke test) and if possible, code signs it for direct distribution. Is this easy to do these days?

No new video today due to a sick kid. Will be back at it tomorrow!

SwiftUI provides us with the @ScaledMetric property wrapper which makes supporting Dynamic Type incredibly easy. It allows us to quickly scale magic numbers. When recording, I didn't realize the video was too long... so here it is as a Dropbox video: www.dropbox.com/scl/fi/bewj3...

In this example, we show the sizing behavior of an `Image` view in SwiftUI, and how you need to be careful when using aspectRatio. It might draw out of bounds. See also: www.swiftuifieldguide.com/layout/aspec...

Here's an experiment: I made a short video to show how to use a `frame(maxWidth:)` to accept the full width. Here's the accompanying SwiftUI Field Guide page: www.swiftuifieldguide.com/layout/flexi...

Last week, our #iOS engineering team at #amex in London had the privilege of hosting a #SwiftUI Workshop by the highly regarded objc.io team, @chriseidhof.bsky.social and Florian Kugler.

Wisdom from my therapist: if you have an argument with someone and one person wins the argument, both lose.