Archive for August 16, 2022

Tuesday, August 16, 2022

Reorder It 1.0.007

Takaaki Onishi (via Accidental Tech Podcast):

Reorder It! is an iPhone App which helps you reorder the addresses.

It’s useful when contact has multiple e-mail address.

I don’t know why standard “Contacts.app” or other AddressBook Apps on App Store don’t have this feature. So I made it.

This is important because the first one in the list is often treated as the default. It also works for phone numbers, physical addresses, URLs, etc.

Safari Extension: Banish

Alex Zamoshchin:

Banish is an ultra-efficient Safari Extension that removes annoying ‘Open in App’ banners and other dark patterns on the web. Block annoying popups and save valuable screen real estate.

Via John Gruber:

If I wanted a long-term lease I’d go to the App Store on my own. Here I am, having already loaded their bloated, poorly-coded webpage, trying to give their site a slice of my attention, and they’re covering their own content — the content I came to their site to see — with a dickpanel suggesting that I install their app.

Sami Fathi:

The banner at the top of Safari is built into Safari and WebKit itself, so to get rid of those, you’ll have to uninstall the respective app from your device. Banish, instead, gets rid of pop-ups implemented in the websites themselves.

Previously:

Slow SwiftUI Closure Actions

Luke Redpath:

TIL - if you’re creating your own SwiftUI environment keys where the value is some kind of “action”, modelled as a closure (e.g. () -> Void) you might see unexpected re-renderings of views that use that @Environment property.

[…]

My hunch - which turned out to be correct - was that closures in Swift are reference types and SwiftUI gets confused when its environment holds reference types. As a clue - note that similar built-in values in SwiftUI are actually structs with callAsFunction() methods.

Update (2022-09-09): Rens Breur:

The underlying reason for this bug is another cool SwiftUI optimization: If a @State variable is not used in the evaluation of a body, changing this variable does not trigger a view evaluation, and does not trigger an update to the view's properties to there values as managed inside the SwiftUI framework. It is a smart optimization, and works well together with memoization: if an input variable is not used, the view does not need to be re-evaluated when it changes, and when it is used, the view only needs to be re-ealuated when it changed.

But in this specific case, it does not work correctly. When we evaluate the body for the first time and the text is collapsed, the state variable is never used, so it seems that it is not needed when evaluating the body. But when we expand the text, the state is read all of a sudden, even though the ContentView itself is not re-evaluated, and the @State is not properly prepared.

There are ways to fix this bug while keeping our content as a closure, but we are now fighting with SwiftUI optimizations instead of making use of them.

Previously:

Removing Unwanted APFS Time Machine Backups

Rich Trouton:

With APFS-formatted Time Machine backup drives, only the option to restore files is available. The Delete Backup or Delete All Backups options are not available.

[…]

You can remove unwanted backups using either the Finder, or by using the tmutil command line tool.

I like browsing and restoring from APFS Time Machine backups, and they seem much better in theory, but I’m tempted to go back to HFS+ because with APFS (at least on Monterey) Spotlight never stops indexing, and there’s no way to turn it off. Alas, Disk Utility doesn’t even make encrypted HFS+ volumes anymore.

Previously: