Not Only Swift

Subscribe
Archives
November 26, 2021

Not Only Swift

👋🏻 Hello everyone!

Thanks to everyone who replied to my newsletter last week - it’s lovely to hear from you, and I appreciate the feedback. As my dear colleague @puf always says, “feedback is a gift”, so keep it coming!

Last week, I mentioned that I was planning to work on something really cool for Firebase Hackweek together with @mbleigh, and I am pleased to say we were able to achieve our goals for the week. If things go well, this will be the beginning of something a lot of you have been asking us for many times. It’s still early days, though, so stay tuned for updates - you’ll hear it here first.

This week, I spent some time on Make It So, the task list app that is a replica of Apple’s Reminder app. Read more about it in the blog post of the week.

As always, don’t forget to let me know if you liked the newsletter (there’s a little yes/no link at the end), and if you did, share it with a friend. If you didn’t like it, why don’t you write me a quick note what you’d like to see improved, and I’ll try to do better next week!

Thanks for reading,

Peter 🔥

This week's blog post

Confirmation Dialogs in SwiftUI

On my quest to replicate Apple’s Reminders app using just pure SwiftUI and Firebase, I spent some time this week to implement a confirmation dialog for Make It So. The idea is to prevent the user from accidentally losing any changes when they leave the edit dialog for a reminder. What seemed like something you might be able to implement in an hour or so ended up being a lot more complex than I would’ve thought in the beginning. Along the way, I discovered a couple of interesting things:

  • actionSheet is deprecated in iOS 15, and has been superseded by confirmationDialog 
  • You can now prevent the user from dismissing a sheet by using the new interactiveDismissDisabled view modifier.
  • Unfortunately, this view modifier lacks one crucial feature.

In the article, I go into more detail how to build a reusable solution for adding confirmation dialogs to your edit dialogs. I also implement a better version of interactiveDismissDisabled, but then I go on to tell you not to use it. Why? Read the article to find out!

SwiftUI

What started as a discussion with a couple of other SwiftUI developers on the thread about replicating Apple’s Reminders app has already turned into a reusable utility for implementing focus handling on SwiftUI List views.

Took another look at this recently, and decided to create a generic package, wrapping all the (at)FocusState code, eliminating the need to create an enum, and use a new property wrapper to focus on your data, not the id.
Example use:https://t.co/GQ7G4ytLk5

— Andrew (@thecraftybrit) November 21, 2021

Great stuff, I love how working in the open inspires people to make contributions to the community!

SwiftUI Environment When Presenting Views
SwiftUI Environment When Presenting Views
I guess most of us. have pulled their hair out at this: SwiftUI inherits the environment down the view hierarchy - mostly! When opening a sheet, this doesn’t seem to be the case - at least on iOS 13 and iOS 14. Here is a quick article by @kharrison that brings some much needed clarity.
useyourloaf.com

Security

Transferring your passwords and other credentials from one password manager to another one is a delicate and intricate process that might cause many of us quite a bit of anxiety. Most people I know stick with their password manager as long as possible. I have several hundred credentials in my password manager, and the idea of migrating them to a different password manager isn’t something I’d take lightly. At 1Password’s recent announcement to use Electron for their upcoming version 8 a lot of Mac users got pretty upset. If you’re on the market for a native password manager, check out this article by @simonbs - it walks through the process of migrating all passwords from 1Password to iCloud Keychain. Simon also discusses how to handle software licenses and backup codes. Definitely worth reading if you want to get an idea how much work is involved to migrate.

Moving from 1Password to iCloud Keychain
Moving from 1Password to iCloud Keychain
Here’s how to easily move your passwords from 1Password to iCloud Keychain
simonbs.dev

Benchmarks

I already covered benchmarks comparing Intel-based Macs to M1-based Macs in issue #12, but the thermal photography in this tweet was too good to not add to this newsletter. It looks like Intel-based MacBooks have an afterburner!

Intel i7 MacBook Pro next to a M1 Pro Max MacBook Pro.

Both have been under the same light workload for the last hour. https://t.co/Tlvs8adhwn pic.twitter.com/IwBtF59VDU

— MG (@MG) November 22, 2021

Podcasts

Decoder is one of my favourite podcasts about the tech industry. In this episode, @reckless talks with the CEO of AirBnB about the future of work. Yep, that’s right - according to Brian Chesky, during the pandemic AirBnB has seen more and more people rent AirBnBs to work remotely. After all, if you can work remotely, you can work from anywhere.

Decoder with Nilay Patel: Why the future of work is the future of travel, with Airbnb CEO Brian Chesky (1h13m)
Decoder with Nilay Patel: Why the future of work is the future of travel, with Airbnb CEO Brian Chesky (1h13m)
Airbnb CEO Brian Chesky prides himself on thinking very differently than other CEOs, and his answers to the Decoder questions about how he structures and manages his company were almost always the opposite of what I’m used to hearing on the show. Airbnb is pretty much a single team, focused on a single product, and it all rolls up to Brian. That’s very different from most other big companies, which have lots of divisions and overlapping lines of authority. And Airbnb’s relationship to cities i…
castro.fm
Don't miss what's next. Subscribe to Not Only Swift:
GitHub X YouTube LinkedIn
Powered by Buttondown, the easiest way to start and grow your newsletter.