Evan Carroll
Evan Carroll

Reputation: 1

Is Apple Foundation open source?

macOS calls its core libraries Foundation. This includes a class that stores cookies on the system called HTTPCookieStorage. Is the source code for this class available anywhere for the public? Or are we only ever given a header file?

Upvotes: -4

Views: 433

Answers (2)

Bjørn Olav Ruud
Bjørn Olav Ruud

Reputation: 1493

There are currently three versions of Foundation in use, all with compatible APIs. On platforms where there exists an Objective-C runtime (like iOS and macOS) the "old" Foundation based on that runtime is used, and that one is closed source.

On platforms without an Objective-C runtime an open-source port is used, which at least in part is based on CoreFoundation.

In addition to that Apple is working on an open-source fully cross-platform version of Foundation written in pure Swift, and I believe the plan is for it to replace the other two when it's feature complete.

As for HTTPCookieStorage the source is here for the variant based on CoreFoundation. It doesn't seem to be implemented yet in the Swift variant.

Upvotes: 1

DaChosenOne
DaChosenOne

Reputation: 1

Apple has open-sourced some of its projects and components, but typically, they don't make the entire operating system or core frameworks like Foundation open source.

You can find open-source projects related to Apple at Apple's official GitHub page, but these projects often do not include core components like Foundation.

Upvotes: 0

Related Questions