Starting in Sierra, Apple's Mac-based OS is renamed to macOS.
All user-facing Swift APIs must go through Swift Evolution. While this is a trivial API change, I have put together a formal proposal as is normal and usual for this process. Here is a draft for public comment.
-- Erica
Gist: macOS.md · GitHub
Aliasing the OS X Platform Configuration Test
Proposal: TBD
Author: Erica Sadun <http://github.com/erica>
Status: TBD
Review manager: TBD
<macOS.md · GitHub
This proposal adds a #if os(macos) platform configuration test to Swift that acts like the current if os(osx)
Swift Evolution Discussion: TBD <applewebdata://3E69BB01-4D94-4BA0-B211-ED51A7CBE547>
<macOS.md · GitHub
Apple renamed its Mac operating system from OSX to macOS, starting in macOS Sierra. Adding rather than replacing "OSX" enables this adoption to be purely additive and supports the notion that Swift-based applications could be deployed to operating systems earlier than Sierrra.
<macOS.md · GitHub Art
Swift currently supports the following platform configuration tests, defined in lib/Basic/LangOptions.cpp.
The literals true and false
The os() function that tests for OSX, iOS, watchOS, tvOS, Linux, Windows, Android, and FreeBSD
The arch() function that tests for x86_64, arm, arm64, i386, powerpc64, s390x, and powerpc64le
The swift() function that tests for specific Swift language releases, e.g. swift(>=2.2)
<macOS.md · GitHub Design
if (Target.isMacOSX()) {
addPlatformConditionValue("os", "OSX");
addPlatformConditionValue("os", "macOS");
}
<macOS.md · GitHub on Existing Code
This is purely additive
<macOS.md · GitHub Considered
I think it's unwise to replace OSX instead of adding macOS due to Apple's large and active userbase that may install Swift-sourced software and not upgrade to the latest operating system.