Once-a-year Black Friday deals are coming. Read more.
Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

Issue 101
Feb 08, 2022

Jumping in and out of context can drain energy.

I've been working mainly at home for almost two years now. I've loved it so far since I saved a lot of time by not having to commute to Amsterdam (35 mins) every day. Though: there's a lot more distraction around here.

I've had a period in which I could quickly become frustrated after being distracted while being in my flow. At moments when I was close to finishing a specific task or solving a nasty bug, Bernie (our dog) or Maaike (my girlfriend) would enter the room to ask me for attention.

You could read my frustration from my response which is not friendly to either dog or Maaike. I also felt terrible afterward: my response was not lovely ánd I didn't finish my task.

I will likely have to jump between contexts even more soon when our baby is here:
- Baby cries
- Dog needs to pee
- Maaike wants a hug
- Antoine wants to write an article!!!
- Repeat

You know what I mean 😉

It was a conversation I had with Paul Hudson who shared his tip for my article on creating a writing habit that inspired me to change how I work.

Paul told me this:

"If there's one tip I *do* live by, it's from the author Roald Dahl. His advice was always to stop writing in the middle of an exciting part of the story – rather than end the day by finishing a chapter in one of his stories; he would instead finish just in the middle of something exciting happening because it made it much easier to pick up the next day."

Now the thing is: distraction is not always something you plan. It's unexpected. Yet, by applying the mindset of

"I can come back to this and finish it later, nice!"

I've allowed myself to feel much more relaxed to jump contexts. Everything will become fine; it will just take a little more time.

Hopefully, this inspires you as well. Enjoy this week's SwiftLee Weekly!

p.s. Don't forget about the Design+Code giveaway

THIS WEEK'S BLOG POST

Lately, I've been working a lot in SwiftUI while building a new app called Looki together with Jordi. During this process, we've been running into several animation issues that I tried to solve using a debugging technique in SwiftUI. This week, I'll explain to you how this debugging tool works.

SPONSORED

With a few lines of code, RevenueCat gives you everything you need to build, analyze, and grow in-app purchases and subscriptions without managing servers or writing backend code. Get started for free.

CURATED FROM THE COMMUNITY

CODE

Ole Begemann made me realize we should also think about cancellation in synchronous methods. In a way, it makes sense, if you compare it to the regular cancellation checks we have to do in async tasks as well. Yet: I was not aware yet!
Since async/await takes away a lot of closures, one might think we don’t have to care about memory management anymore. Though: we still have the Task initializer, which requires us to consider referencing objects weakly. John Sundell takes us through what this means with clear examples, as always.
Returning a concrete type without exposing the actual type is a valuable feature introduced in Swift 5.1. Natascha Fadeeva explained how this works and made me realize I’m still only often using this in SwiftUI for returning views. It’s about time to get my hands dirty with this feature again and make use of it in different places!
I agree that I would love to see a dedicated method to refresh the complete user interface style ourselves. This happens to your app when switching between dark and light mode, but then it would be triggered for a custom theme in-app. Christian Selig shares his part of this story and why he thinks it’s a welcome addition to iOS 16.
I enjoyed this article by Jordan Morgan telling me that the fixedSize() modifier should be called justTakeTheSpaceYouNeedAndNoMore(). On the serious side: I’ve been using fixedSize() quite often, but I never really knew what it was doing. I’m glad I know now!
SwiftUI is hot these days, which makes us almost forget about UIKit. Tibor Bödecs did not and shared ten powerful tips, which I didn’t know all either! I especially liked the tip about context menus and UIButtons.

ACCESSIBILITY

When adding VoiceOver accessibility support to dynamic views, you might quickly end up in a situation in which your voice-over does not take into account a view that updates while being focussed. Keith Harrison demonstrates such an example and explains how to solve this with a one-liner.

TALKS

New to SwiftUI but used to UIKit? You might enjoy this talk by Five Stars Blog sharing SwiftUI lessons.

SWIFTLEE JOBS

Post your company's job positions for free

Make sure to post your company's open job positions for free at SwiftLee Jobs and reach thousands of developers.
With tens of millions of active users, we’re among Europe’s leading iOS app developers. Our team of iOS engineers has been a driving force in our ascent so far. We...
For our Chat SDK team we are seeking an iOS SDK Developer to work on our native iOS SDK libraries. This role is open in our Boulder office and is...
TL;DR Build for macOS, iOS and iPadOS in SwiftUI. Salary £80k in salary and stock options + 0.25% equity in stock options Get good perks and work from a dope...

THANK YOU

Thanks for being a SwiftLee subscriber! 
Continue your journey: