Just like Microsoft there are parts of the company who are hostile to open source, and there parts of the company whose success is attributable to open source.
Swift is OSS, but it's not a great example to illustrate your point.
Darwin’s underlying code was BSD license and didn’t require releasing source code.
Darwin is also a bad example:
"On July 25, 2006, the OpenDarwin team announced that the project was shutting down, as they felt OpenDarwin had "become a mere hosting facility for Mac OS X related projects", and that the efforts to create a standalone Darwin operating system had failed.[40] They also state: "Availability of sources, interaction with Apple representatives, difficulty building and tracking sources, and a lack of interest from the community have all contributed to this."[41]"
"PureDarwin is a project to create a bootable operating system image from Apple's released source code for Darwin.[43] Since the halt of OpenDarwin and the release of bootable images since Darwin 8.x, it has been increasingly difficult to create a full operating system as many components became closed source."
Apple cooperates within WebKit well with WebKitGtk. They supported LLVM when it is in their interest.
Chrome is used as proprietary web-engine to vendor lock-in the web. While often used by others, I’m not aware of a broad cooperation. Android is a shadow of Linux, merely using the Linux-Kernel, not GNU. Plus a lot of closed-source code (PlayServices, App Signatures, Google Cloud, Google Apps).
Googles open-source projects seem often exclusive Google only projects? Google works together with others! But especially Chrome and AOSP are…causing worries.
There's a reason most of these projects picked AOSP over iOS, or even Chromium over WebKit. Google just engages with the community better than Apple. It's silly to pretend like they're on the same level.