Drux Drux - 1 year ago 65
Swift Question

Concise Swift assertion for Bool? || Bool?

Can I formulate a concise expression in Swift for asserting that the activity indicator of one of two view controllers is animating. The expression may assume that either

is distinct from

The following does not quite work, presumably because it is of the form
Bool? || Bool?
instead of
Bool || Bool

assert(vc1?.activityIndicator.isAnimating ||

Answer Source

== still works for optionals, so you could do something like this:

assert(vc1?.activityIndicator.isAnimating == true ||
       v22?.activityIndicator.isAnimating == true)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download