Starting in iOS 14.5, this rdar:62886135 is implemented:
Types conforming to any style protocol, such as
ToggleStyle, are now enforced to be value types. Styles must be structures or enumerations, not classes, and conforming a class to a style protocol may trigger an assertion. This is the same restriction that the system has always enforced on types conforming to
Source: Apple Developer Documentation
How is it implemented and is it possible to use this enforcement in custom libraries too?
Edit: It sounds like a runtime and not a compile-time assertion.