Archive for August 12, 2022

Friday, August 12, 2022

Swift Pitch: “borrow” and “take” Parameter Ownership Modifiers

Joe Groff:

We propose new borrow and take parameter modifiers to allow developers to explicitly choose the ownership convention that a function uses to receive immutable parameters. This allows for fine-tuning of performance by reducing the number of ARC calls or copies needed to call a function, and provides a necessary prerequisite feature for move-only types to specify whether a function consumes a move-only value or not.

[…]

Looking to the future, as part of our ongoing project to add ownership to Swift, we will eventually have move-only values and types. Since move-only types do not have the ability to be copied, the distinction between the two conventions becomes an important part of the API contract: functions that borrow move-only values make temporary use of the value and leave it valid for further use, like reading from a file handle, whereas functions that take a move-only value consume it and prevent its further use, like closing a file handle. Relying on implicit selection of the parameter convention will not suffice for these types.

Previously:

iOS 16 Battery Icon and Text Out of Sync

Tim Hardwick:

In iOS 15 and earlier, battery percent has not been present on iPhones that have Face ID because of the lack of space on either side of the notch that houses the TrueDepth camera hardware. The new design adds the specific battery level to the battery icon, providing a better idea of battery status at a glance.

In Apple’s latest design, the white battery icon remains completely filled in as the battery level gradually depletes. When the semi-transparent percentage reaches 20% or lower, a fifth of the battery icon turns red and the rest of the icon becomes semi-transparent, while the percentage inverts to white.

Mikael Johansson:

Nothing wrong with what Apple released but I think I might’ve preferred something like Alternative A for the battery indicator

I like the iOS 15 indicator that only shows the percentage in Control Center. I don’t want to see the number all the time, just like I don’t set Mail or NetNewsWire to show the unread count in the Dock. It’s distracting.

Update (2022-09-14): Sami Fathi:

Apple has confirmed that users of older generation iPhone models will miss out on the ability to show their iPhone’s battery percentage directly in the status bar.

Juli Clover:

With this [iOS 16.1 beta] update, iPhone 13 mini, iPhone 12 mini, iPhone XR, and iPhone 11 users can see their battery percentage in the status bar, and battery percentage is officially available on the iPhone XR and later. Devices without a Face ID notch always display the battery percentage as well.

Meta Apps Inject Tracking Code

Felix Krause (Hacker News):

Meta injects tracking code into all websites displayed inside their app without the user’s consent, nor the website operator’s permission

This is done by the iOS and Android apps of Instagram, Facebook and FB Messenger

This introduces a range of big security and privacy implications for the end-user, with Instagram being able to steal usernames, passwords and addresses, as well as monitoring screenshots you take, hiding website encryption status from the user and more

[…]

Apple has built “App-Bound Domains”, which could help avoid this kind of platform abuse, however it’s not mandatory yet.

Unfortunately, even the iOS Lockdown Mode doesn’t prevent Instagram fetching user data from third party websites.

Here’s the post.

Kate Cheney:

Once the WKAppBoundDomains key is added to the Info.plist, all WKWebView instances in the application default to a mode where JavaScript injection, custom style sheets, cookie manipulation, and message handler use is denied. To gain back access to these APIs, a WKWebView can set the limitsNavigationsToAppBoundDomains flag in their WKWebView configuration[…]

Previously:

Apple Is Building a Demand-side Platform

Ronan Shields (Hacker News):

Apple may have blown up the digital ads business but it left enough fertile ground to build its own, more focused play for media dollars. The company is building a demand-side platform if recent job listings are to be believed.

[…]

It remains unclear if the intended DSP is geared toward serving ads solely on Apple’s owned and operated properties, such as the App Store itself or on the millions of iOS apps, or even on third-party properties such as the mobile web.

Apple would not confirm its plans to build a DSP or provide additional context as to how this would fit into the overall company’s strategy for its ad business. But the job posting is a clear signal of intent for the business that has left the impression (at least publicly) that building ad tech is the last thing it wanted to do.

Previously:

Update (2022-08-29): Tim Hardwick:

In the latest edition of his “Power On” newsletter, Gurman writes that Apple’s VP of advertising platforms Todd Teresi wants to triple current ad revenue, and the first move to achieve that could be to bring ads to the Maps app. Apple has internally tested adding sponsored spots in Maps search results, reports Gurman, and if it does roll them out to Maps users, it could just be the beginning of a wider expansion.

Gurman speculates that Apple could also bring ads to the digital storefronts of its Books and Podcasts apps[…]

Update (2022-09-09): Nick Heer:

Even so, I firmly believe an expansion of ads across its platforms concurrent with its efforts to rein in others’ tracking behaviour — and, by extension, impacting small business advertisers — will damage Apple’s credibility and users’ satisfaction. Nobody is going to not buy an iPhone because there are ads in Maps, for example, but plenty of people who use Maps are going to feel a little cheated.

The maxim “if you are not paying for the product, you are the product” is as inaccurate as it is a cliché. If Apple really is planning to put more ads in its products, it shows that you can pay thousands of dollars and still be the product — because the line on each chart must go up.

See also: Hacker News.