John McCall (forum):
However, this approach has significant problems. The biggest is that the get
accessor has to return an independent value. If the accessor is just returning a value stored in memory, which is very common for data structures, this means the value has to be copied.
[…]
This vision document lays out the design space of accessors for the next few years, as Swift continues to advance its support for non-Copyable
and non-Escapable
types. It explains Swift’s basic access model and how it may need to evolve. It explores what developers need from accessors in these advanced situations. Finally, it discusses different kinds of accessors, both existing and under consideration, and how they do or do not fit into the future of the language as we see it.
[…]
The yield
accessor is the natural most-general model of a borrowing read access. It is a coroutine function which yields a borrowed value and can then do arbitrary finalization when resumed.
The borrow
accessor is a specialization of that model which expresses that no finalization is required. It is an ordinary function that returns a borrowed value.
[…]
yield inout
and mutate
are both modification accessors.
[…]
unsafeAddress
is functionally a borrowing read accessor. It is an ordinary function that returns an UnsafePointer<ValueType>
.
Previously:
Language Design Optimization Programming Swift Programming Language
John Voorhees:
Delta, the MacStories Selects App of the Year, received an important update today that allows users of the game emulator to support its development via Patreon from inside the app. Existing patrons can connect their Patreon accounts from Delta’s settings, too, allowing them to access perks like alternative app icons and experimental features.
This is a big deal that goes beyond the new features for Delta supporters. According to the app’s developer, Riley Testut, Delta is the first app he’s aware of in the U.S. App Store to include an in-app link that allows users to make purchases outside the App Store using Apple’s External Purchase Link Entitlement that was introduced in January.
I guess this is progress, but now Delta is responsible for regularly sending Apple a commission and financial reports.
Previously:
App Store Business Delta Emulator iOS iOS 18 iOS App Patreon
John Siracusa:
Welcome to my new series on things I don’t understand about Apple’s premier user interface framework.
[…]
To be clear, these are things I don’t understand, not necessarily things that are “wrong.” They sure look wrong (or at least “suboptimal”) to me! But maybe there are good reasons, and I just don’t know them yet. SwiftUI experts and historians, please tell me!
Previously:
Update (2025-01-10): John Siracusa (GitHub):
Why is there (apparently?) no Picker
style on macOS that can be configured with a fixed width, like NSPopUpButton
in AppKit?
For example, consider a text field for numeric input followed by a picker for units, both aligned to the right side of a System Settings-style Form. Each time you pick a different unit, the Picker
changes width and moves the text field.
John Siracusa:
Q: Why is Xcode no longer able to render a preview of my SwiftUI view?
A: Sometimes, the answer is that you’ve got a call to a log method on a Logger
object in a code path that’s executed when rendering a preview but rarely or not at all otherwise, and this call passes a string without any values interpolated into it (e.g., logger.log("Hello")
). This causes an error, and this error is only visible in the big spew of output available through the stethoscope icon in the preview pane.
John Siracusa:
ScrollView
on macOS includes default support for swipe gestures and mouse scroll wheels, but not page up/down, home/end, or arrow keys?
See also: the Mastodon tag.
Update (2025-01-17): John Siracusa:
Why can’t I find a simple way to do this?
.textSelection(allowSelection ? .enabled : .disabled)
Mac macOS 15 Sequoia Programming SwiftUI
Daniel Kennett:
I’ve been shipping apps to the App Store for well over fifteen years now, and although there are App Review horror stories aplenty, I’ve always hoped I’d never be in a position to write one myself.
[…]
What you just scrolled past was the history of my (eventually successful) attempt to get the new Mac version of our app — Cascable Studio — approved for the Mac App Store. The entire process took nearly a month, and we had to push an emergency build through in the middle there with some features stripped out to get something approved for launch.
[…]
We’re at version 7.0 now, and the iOS version of this app has been on the App Store since 2015. Indeed, most of the app was fine — this ordeal was all about one particular feature.
A feature that’d already been approved and on the App Store since 2019 in a different app of ours.
[…]
Anyway, I must’ve explained what Apple Events are to three separate people throughout this process. This did eventually get to someone technical up at the appeals board, but nobody having any idea what an “Apple Event” is really cannot have helped.
App Review doesn’t like apps that integrate with other apps, which is one of the best things about the Mac.
Update (2024-12-20): Matthias Gansrigler:
If you’re wondering why there hasn’t been an update for
@ScreenFloatApp
recently…
#reviewhell #securitytheater
Previously:
Update (2025-01-08): Adam Demasi:
Use of Apple Events turned a quick utility I wrote many years ago into an absolute headache. It was a Finder plugin that opens your terminal app to the current directory using NSWorkspace. 1.0 approved just fine. Users wanted control over whether it opens as a new tab, window, even the same tab. Threw that together with Apple Events. The ensuing fight with App Review took longer than writing the code. I released outside the App Store, then discontinued the app, exhausted.
App Store Rejection AppleScript Cascable Studio Entitlements Mac Mac App Mac App Store macOS 15 Sequoia