Apple's relationship with open source is pretty average. In the end, they use open source strategically. If there's no benefit to open-sourcing something, they won't.
Clang, WebKit and Swift are "proper" open source projects, done in the open. But there aren't many of those. They have no open source apps, and most frameworks such as Cocoa, AppKit etc. are completely proprietary.
Some of their open source efforts have been half-hearted; Darwin was enthusiastically embraced by the community, then essentially shut down by Apple. The XNU sources are APL, but there's nothing open about its development. I/O Kit is closed, I believe.
A lot of companies routinely open-source lots of little things that could easily have stayed internal, but are genuinely useful to everyone else. (Admittedly, I think about 30% of them are Go logging libraries, but the point still stands.) I.e., open source by default as opposed to being the exception.
That, of course, can be a strategy. A company can look cooler and attract talent by developing everything in the open.
Webkit was open-source long before anticipating killing Flash. I think, like Darwin, it was originally open-source because it had to be, due to its origin in an existing open-source project that required derivatives also be open-source.
They don't but they both perform much better than Apple on the subject.
React is one of the leaders in JS dev and several other Facebook projects are quite useful.
Microsoft is the company with the biggest number of open source contributors and several of their projects like TypeScript are extensively used and they are the biggest contributors to LINUX https://octoverse.github.com/
Apple made Swift an open source language that runs only on their proprietary devices and that's it...
Swift does not run "only on their proprietary devices". It runs on at least Linux as well.
I'm not saying that Apple is better, or denying that Facebook does a 'better job', but instead just reinforcing the concept that all these technology companies don't open source out of the goodness of their heart, but instead for the same strategic decisions that Apple does it for.
They do have at least one open source application: https://www.cups.org/
it's fully open-source, and wholly owned by Apple, however they bought it, they didn't invent it.
They also lead development of LLVM and clang, which is a _huge_ project, and very useful (although sometimes without full realization of that fact) to the Open Source ecosystem.
Clang, WebKit and Swift are "proper" open source projects, done in the open. But there aren't many of those. They have no open source apps, and most frameworks such as Cocoa, AppKit etc. are completely proprietary.
Some of their open source efforts have been half-hearted; Darwin was enthusiastically embraced by the community, then essentially shut down by Apple. The XNU sources are APL, but there's nothing open about its development. I/O Kit is closed, I believe.