Swift needs a clean way to serialize model variants (e.g., exclude sound settings when syncing game state via iCloud)

In a game, you might want to serialize the game state both to disk and to iCloud, but exclude the sound settings from iCloud so that device-specific settings aren’t overwritten when syncing across devices.

There are various workarounds in Swift to achieve this, but it would be nice if the language directly supported this use case.

What features would you add to Swift to make this possible?