News for hackers. Stuff that matters.
Re:Apple ExtensionKit by duped on Monday October 31, 2022 @02:29PM (#33410329)
I'd like to take this moment to call out how atrocious Apple developer documentation is. This is honestly embarrassing. I would reject contributions at my company that shipped APIs/headers with this caliber of documentation. People who do it regularly get bad performance reviews.

I don't know if it's because they actually hate developers, or they're just bad developers themselves.

Re:Apple ExtensionKit by apozem on Monday October 31, 2022 @03:28PM (#33411440)
They have a ton of different products and APIs and they just don't document them all. Even worse, much of the documentation they do have is hidden inside hard-to-search WWDC session videos or, ugh, Slack conversations with Apple engineers.

External developers have complained for years. [1]

[1]: https://www.caseyliss.com/2020/11/10/on-apples-pisspoor-docu...

Re:Apple ExtensionKit by duped on Monday October 31, 2022 @04:15PM (#33412293)
At this point I'm starting to believe that Apple begrudgingly accepts that people outside that UFO that landed in Cupertino should be granted the privilege to develop applications for their hardware.
Re:Apple ExtensionKit by danielvaughn on Monday October 31, 2022 @03:35PM (#33411544)
You'd think with nearly a trillion in cash, they'd be able to hire some full-time technical writers.
Re:Apple ExtensionKit by mattiemass on Monday October 31, 2022 @05:37PM (#33413591)
The only reason I was able to figure out how to use ExtensionKit at all was because of a chance encounter with an Apple engineer during WWDC that provided some needed information.

I'm sorry to disappoint, but ExtensionKit/Foundation do not make use of any Swift features in the way you describe. It's all just IPC (via XPC), so much of it is useable from ObjC, or even C!

Also, this does not provide a direct app-to-app communication channel. The extensions themselves must be separate executables and run within their own sandbox. I think the extension could communication with its containing app, but the system is not set up to do that. All your scheduling questions are really around how XPC works. The view itself is basically an image within your hosting app, so communication is entirely async to the other process.

Re:Apple ExtensionKit by dwaite on Monday October 31, 2022 @06:26PM (#33414187)
> I think the extension could communication with its containing app, but the system is not set up to do that.

and on iOS, the containing app is likely not running (in a GUI context).

Typically, the extension is its own small program bundled within the app. The app can be run by an end user, while the extension can only be invoked via the extension mechanism.

Re:Apple ExtensionKit by mattiemass on Monday October 31, 2022 @07:23PM (#33414781)
Same thing on macOS. The containing app does not need to be running for the extensions to be active. You are right that the extension bundle can only be used by this mechanism, but interestingly the containing app can use its own extensions (though this may not make sense in many cases).
Re:Apple ExtensionKit by duped on Tuesday November 01, 2022 @01:29AM (#33417315)
That's sad that it has a serialization layer. It makes sense, but it's not ideal or more performant than existing techniques.

I'm more interested in the extension handling after that IPC layer, it's usually non trivial to integrate the call into an existing app's threading model.