Facebook is an application / services company, so it wants its competitors to be non-existent or expensive (luckily, so far, it's more the first than the second), and its complements to be free / cheap and ubiquitous. Hardware / software / networks are its complements so it tries to make them free (give away internet access, build open source servers and routers, make cross-platform libraries, and so on).
Google is in much the same boat, and does much the same kinds of thing.
Apple is the reverse, so it wants its platform to be anything but a commodity, but apps to be free / cheap and ubiquitous (hence the App Store). Similarly, insofar as it creates differentiating development tools, it would prefer they be platform exclusive. (Swift isn't a positive differentiator; it mostly addresses a platform disadvantage, so it's free and open source.)
http://www.joelonsoftware.com/articles/StrategyLetterV.html
Facebook is an application / services company, so it wants its competitors to be non-existent or expensive (luckily, so far, it's more the first than the second), and its complements to be free / cheap and ubiquitous. Hardware / software / networks are its complements so it tries to make them free (give away internet access, build open source servers and routers, make cross-platform libraries, and so on).
Google is in much the same boat, and does much the same kinds of thing.
Apple is the reverse, so it wants its platform to be anything but a commodity, but apps to be free / cheap and ubiquitous (hence the App Store). Similarly, insofar as it creates differentiating development tools, it would prefer they be platform exclusive. (Swift isn't a positive differentiator; it mostly addresses a platform disadvantage, so it's free and open source.)