UTIKit icon indicating copy to clipboard operation
UTIKit copied to clipboard

Add `conforms(to:)` API

Open amomchilov opened this issue 5 years ago • 0 comments

Two-case switch statements aren't nice when there's no expectation of future cases. I just want do a simple conformance check which results in a Bool, just like UTTypeConformsTo(_:_:), but without the CFString boilerplate.

I could do it with

let doesConform = uti ~= candidateParentUTI

but it's quite cryptic.

let doesConform = uti.conforms(to: candidateParentUTI)

Would be better, undesputably so, IMHO.

Thoughts?

amomchilov avatar Sep 11 '19 03:09 amomchilov