[swift-evolution] Pitch: Import Objective-C Constants as Enums

Zach Waldowski zach at waldowski.me
Fri Jan 29 13:22:27 CST 2016

+1 one to the updated proposal. I like the change a lot, even if it's
even more pain for the poor framework teams. ;-)

Apropos of nothing, a coworker reminded me today of something that would
fit well into this proposal, even if only as a clarifying example: UTIs
are a great instance of "strongly-typedef'ed strings", with the
possibility of user-defined cases, and whose use in Cocoa APIs is often
ambiguous. There are several hundred constants, too, so it'd be a good
stress-test for everything in the proposal.

Cheers! Zachary Waldowski zach at waldowski.me

On Fri, Jan 22, 2016, at 04:14 PM, Jeff Kelley via swift-evolution wrote:
> I have updated the proposal[1] to use struct over enum
> (https://github.com/SlaunchaMan/swift-evolution/blob/import-objc-constants/proposals/0000-import-objc-constants.md)
> .
>> On Jan 20, 2016, at 11:01 PM, Douglas Gregor
>> <dgregor at apple.com> wrote:
>> FWIW, I suggest that you put “String” somewhere in the title of your
>> proposal when you revise it.
> Would this need to be limited to strings? There are other “magic
> constants” that could conceivably be imported as structs—I’m thinking,
> for instance, error codes.
> Jeff Kelley
> SlaunchaMan at gmail.com | @SlaunchaMan[2] | jeffkelley.org
> _________________________________________________
> swift-evolution mailing list swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution


  1. https://github.com/SlaunchaMan/swift-evolution/blob/import-objc-constants/proposals/0000-import-objc-constants.md
  2. https://twitter.com/SlaunchaMan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160129/e026edc3/attachment.html>

More information about the swift-evolution mailing list