It’s never safe to persist raw values of enums. The not only can change in time, raw values for same cases might be different on different platforms, like with NSTextAlignment. Addressing Architectural Differences in Your macOS Code.