Archive for February 28, 2024

Wednesday, February 28, 2024

Making Friends With AttributeGraph

Saagar Jha:

If you’ve used SwiftUI for long enough, you’ve probably noticed that the public Swift APIs it provides are really only half the story. Normally inconspicuous unless something goes exceedingly wrong, the private framework called AttributeGraph tracks almost every single aspect of your app from behind the scenes to make decisions on when things need to be updated. It would not be much of an exaggeration to suggest that this C++ library is actually what runs the show, with SwiftUI just being a thin veneer on top to draw some platform-appropriate controls and provide a stable interface to program against. True to its name, AttributeGraph provides the foundation of what a declarative UI framework needs: a graph of attributes that tracks data dependencies.

Mastering how these dependencies work is crucial to writing advanced SwiftUI code. Unfortunately, being a private implementation detail of a closed-source framework means that searching for AttributeGraph online usually only yields results from people desperate for help with their crashes.


Shortly before a view’s body is computed, it goes through and sets the _location on all relevant State variables, so that they are ready for dependency tracking. Typically, a property wrapper does not have the ability to grab context from outside of itself (for example, by looking up who owns it). SwiftUI can use reflection much like we did to discover State members that it needs to install _location on, sidestepping this issue. To discover State in nested types, it needs a little bit of help: this is why we had to add a DynamicProperty conformance earlier. In that case, it uses reflection to look for DynamicProperty members instead and then does a search for State inside of those.


Apple Cancels Car Project

Juli Clover (Mark Gurman, Hacker News, Slashdot):

Apple has canceled all plans to release an autonomous, electric vehicle, reports Bloomberg. Apple has been working on an Apple Car for more than a decade and invested millions of dollars into development before deciding it was not a viable project.

Apple’s Chief Operating Officer Jeff Williams today told approximately 2,000 employees working on the Apple Car that the project was canceled, and the information reportedly came as a surprise.

Apple surely spent billions on it, not millions.

John Gruber (Mastodon):

Kevin Lynch took over leadership of Project Titan back in September 2021, but remained in charge of Apple Watch, too. In hindsight that makes me wonder if Lynch’s mission wasn’t to ship a car, but more to assess what technologies the group had created could be used to create other products. Whatever progress Apple has made with “autonomy” ought to be applicable to robots, for example. Making intelligent robots feels more like something Apple should be doing than making cars.

Hartley Charlton:

Founder and chairman Lei Jun today posted on Weibo that he was “very shocked” by the news of Apple’s decision to cancel its EV. He added that he “knows deeply how difficult it is to make cars,” but Xiaomi has made an “unshakeable strategic choice” to move into EVs. He Xiaopeng, chairman of Chinese EV maker Xpeng, expressed similar disbelief that Apple is abandoning its car plans.

Adam Engst:

Perhaps the most interesting part of Gurman’s piece is the claim that many of the Project Titan employees will be shifted to Apple’s artificial intelligence division to focus on generative AI projects. Siri could use the help.

Mr. Macintosh:

The rumored Apple Car was one of most embarrassing projects in Apple’s history.


Imagine if all the wasted billions of dollars was instead put into the Siri team!🤦‍♂️

Benjamin Mayo:

Self-driving or nothing has been the Apple Car mission since the beginning. It seems they finally resigned themselves to the former not being possible.

Kontra (Mastodon):

Apple’s problem with Titan was not complicated, almost singular: like everyone else, they found out L5 was/is not achievable and there really was no point introducing a car without it in mid-2020s.

Eric Schwarz:

Over the last couple of years, it has started to feel like Apple is spread too thin at times and while the employees working on the car won’t jump over to go fix That Bug You Hate™ in iOS now, I think it removes a notable distraction for the company.


They couldn’t afford to develop a bog standard calculator app, they were busy not making a car.

Jeff Johnson:

But I so wanted a car that demanded 30% of every shopping trip and refused to travel to destinations unapproved by the manufacturer.

Joanna Stern:

I was actually really looking forward to what they were going to do in this space—and flipping my car over to charge it.

Whole Mars Catalog:

It pains me to announce that I was fired from Apple today.

I was the engineer responsible for designing the charge port at the bottom of the Apple car.

Brandon Butch:

Was looking forward to the Apple iLift for making charging easier

Tony Fadell:

Apple doesn’t have any real technology or UI advantage in autos (& TVs).

That’s why Apple doesn’t make TVs (only AppleTV) & it’s same reason it shouldn’t make typical cars/EVs (iPhones + CarPlay is fine enough)

Florian Mueller:

Instead of making a car, Apple will just leverage its platform power to tax car makers and their customers.


Update (2024-03-01): Juli Clover:

Apple spent more than $10 billion working on the Apple Car over the last decade, according to a report from The New York Times that details the issues the project faced during development. Apple first launched the project in 2014 and let it flounder for more than a decade before calling it off earlier this week.

Money was spent on research and development, along with the thousands of Apple engineers and car experts that worked on the project. Some employees within Apple are said to have suspected that the endeavor was likely to fail from the beginning, and they referred to the car as “the Titanic disaster” instead of its “Project Titan” codename.

Brian X. Chen and Tripp Mickle (Hacker News):

It had just finished the Apple Watch, and many engineers were restless to begin work on something new. Tim Cook, Apple’s chief executive, approved the project in part to prevent an exodus of engineers to Tesla.


Despite having a vote of confidence from Apple’s chief executive, members of the team knew they were working against harsh realities, according to the six employees familiar with the project. If it ever came to market, an Apple car was likely to cost at least $100,000 and still generate razor-thin profit compared with smartphones and earbuds. It would also arrive years after Tesla had dominated the market.


The group developed an array of new technologies, including a windshield that could display turn-by-turn directions and a sunroof that would feature special polymer to reduce heat from the sun.


One day, in the fall of 2015, Mr. Ive and Mr. Cook met at the project’s headquarters in Sunnyvale, Calif., for a demonstration of how the car might work. The two men sank into the seats of a cabinlike interior. Outside, a voice actor read from a script of what Siri would say as the men zoomed down the road in the imaginary car.

The article has a “struggled to develop new products in the years since Steve Jobs’s death” angle, which I disagree with with.

Juli Clover:

The Apple Car is one of the longest running rumors that we’ve been reporting on without a product materializing, so we thought we’d take a look back at some of the key moments in the Apple Car ‘s history to provide some insight into what went wrong.


I knew a few people who worked for one the traditional car manufacturers back when Apple made the first big car announcement and apparently 'everybody' there sent in their CVs to Apple. The only people who heard back were the people from either design departments or who worked with electronics or software. People who actually work with engineering and building the actual cars, as in chassis, suspension, engines and other stuff made out of metal heard nothing. That was when it became clear to me that Apple had no real interest in ever actually building a car.

Bloomberg (2017, via Kontra):

Cook Says Apple Is Focusing on Autonomous Car Systems

Nick Heer:

Much reporting during its development was similarly bizarre due to the nature of the project. Instead of leaks from within the technology industry, sources were found in auto manufacturing. Public records requests were used by reporters at the Guardian, IEEE Spectrum, and Business Insider — among others — to get a peek at its development in a way that is not possible for most of Apple’s projects. I think the unusual nature of it has broken some brains, though, and we can see that in coverage of its apparent cancellation.

Steve Troughton-Smith:

The Apple Car project is something the company can come back to in the future; right now, there is an AI sea change happening that could obviate whole categories of technology, and it seems like it's worth playing that out before trying to return to autonomous vehicles. The artificial driver of the future may be sparked by advancements completely out of left field that don't come directly from traditional or legacy machine learning

See also: Dithering.

Update (2024-03-07): Mark Gurman and Drake Bennett (MacRumors, Hacker News):

Most important, the Bread Loaf would have what’s known in the industry as Level 5 autonomy, driving entirely on its own using a revolutionary onboard computer, a new operating system and cloud software developed in-house. There would be no steering wheel and no pedals, just a video-game-style controller or iPhone app for driving at low speed as a backup. Alternately, if the car found itself in a situation that it was unable to navigate, passengers would phone in to an Apple command center and ask to be driven remotely.


Field, who’d been hired away from Tesla Inc. to oversee the project, proposed scaling back the self-driving goals to Level 3, which requires a human driver to be ready to take over at a moment’s notice, not watching TV or FaceTiming in a backward-facing seat. But Field’s bosses wanted Level 5.


The front and the back were identical, and the only windows were on the sides, a design choice with potentially dire consequences in the event that a human needed to do any driving.


Within the company, it was difficult to find spare engineering talent, with attention focused on preparing for the upcoming Apple Watch release and, later, the iPhone X, but Riccio managed nonetheless to poach several dozen engineers from other projects. […] The infighting began almost immediately. Maestri, the CFO, remained a skeptic, as did Craig Federighi, Apple’s software engineering chief, who had to donate personnel to what he considered a vanity project.


For Field, Mansfield and others on the team, Cook’s indecision was frustrating. “If Bob or Doug ever had a reasonable set of objectives, they could have shipped a car,” says someone who was deeply involved in the project. “They’d ask to take the next step, and Tim would frequently say, ‘Get me more data, and let me think about it.’”

Jason Snell:

Sounds like a lot of people inside Apple knew this project was a disaster, and that Tim Cook failed to provide a vision and decisive leadership. Though I do appreciate the internal argument about why to start the project in the first place: “Would you rather compete against Samsung or General Motors?”

Update (2024-03-11): Marcin Krzyzanowski:

7 years ago Apple contacted me because somebody noticed my past experience work at Nissan Automotive 🚙. They didn’t want to say the exact team they’re recruiting to. After 7 months long interview process (rly, 13 rounds) I’ve got ghosted eventually.

Today I think that was Apple Car

Mark Gurman:

The Apple car’s circa-2020 design resembled the Canoo Lifestyle Vehicle — a futuristic van with rounded edges — but it had dark black windows with an adjustable tint. There was all-glass sunroof, a pure white exterior and whitewall tires with a black center. The front and back were identical, so it would always look like you were driving forward. It looked like no other mass-produced vehicle — and was optimized for full, Level 5 self-driving.


The car’s last major design — still a variation on the original Bread Loaf idea — traded in a sliding van door for gull-wing doors like on a Tesla Model X. Even more so than with prior iterations, it wasn’t designed for a traditional driver: The vehicle featured a front and back with such dramatic pinched curves that there was little room for front or rear windows. When Apple ultimately decided to switch from Level 5 autonomy to something around Level 2, the company needed to add back a steering wheel and pedals, as well as front and back windows. By the end, the car had two seats facing forward that could swivel.

Update (2024-04-08): Juli Clover:

Apple this week filed a required notice with the state of California, confirming plans to permanently lay off more than 600 employees.

FastScripts 3.3

Red Sweater:

This update includes a major new premium scripting addition, facilitating mouse automation by providing a variety of new scripting commands, including a powerhouse for synthesizing clicks and drags[…]


When automating mouse events, the clicks, drags, and releases can happen so fast that it confuses or overwhelms some interface components. For this reason, FastScripts imposes a short delay between the generation and delivery of each individual event that makes up a requested automation command. I’m calling this delay the event cadence, and it can be overridden with a longer or shorter cadence by supplying a parameter to the click mouse command, or for the duration of a whole script by setting this property[…]


Finally, there are two new properties for querying the state of the mouse and keyboard:

  • current mouse position
  • current keyboard modifiers

See also: PreFab Player.