0

I'm using a struct containing a property of type UIStatusBarStyle and like to use the "auto equatable feature" of Swift 4.1 for this struct.

The documentation of UIStatusBarStyle shows it's an enum of type int, but doesn't say "conforms to Equatable". Is it equatable? Are there any docs for this?

user3532505
  • 429
  • 1
  • 7
  • 18
  • do you want to use the default feature? Check this link: https://developer.apple.com/documentation/uikit/uistatusbarstyle – Priya Apr 09 '18 at 11:53

1 Answers1

0

You can rely on automatic synthesis of the Equatable protocol’s requirements for a custom type when you declare Equatable conformance in the type’s original declaration and your type meets these criteria:

  • For a struct, all its stored properties must conform to Equatable.
  • For an enum, all its associated values must conform to Equatable. (An enum without associated values has Equatable conformance even without the declaration.)

https://developer.apple.com/documentation/swift/equatable

user3532505
  • 429
  • 1
  • 7
  • 18