• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Swift -> Obj-C: return __kindof Something
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Swift -> Obj-C: return __kindof Something


  • Subject: Re: Swift -> Obj-C: return __kindof Something
  • From: Quincey Morris via Cocoa-dev <email@hidden>
  • Date: Mon, 11 Nov 2019 18:48:14 -0800

There’s now a Swift equivalent (loosely): “some NSManagedObject”. It’s
sometimes referred to as a “reverse generic”, or “opaque type” because it hides
the actual type behind a larger class type or protocol. The evolution proposal
is here, if you want all the gory details:


https://github.com/apple/swift-evolution/blob/master/proposals/0244-opaque-result-types.md

<https://github.com/apple/swift-evolution/blob/master/proposals/0244-opaque-result-types.md>

The problem is, it was designed mainly for return types, and I’m not sure it’s
entirely easy to use for a stored property. On top of that, it may not work
with an optional base type.

Still, it might be worth looking into. Again, ask on the Swift forum for
guidance. You’ll get good answers.

> On Nov 11, 2019, at 18:06 , Steve Christensen <email@hidden> wrote:
>
> I’m trying to get the same class-or-subclass behavior during compilation.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Swift -> Obj-C: return __kindof Something (From: Steve Christensen via Cocoa-dev <email@hidden>)
 >Re: Swift -> Obj-C: return __kindof Something (From: Quincey Morris via Cocoa-dev <email@hidden>)
 >Re: Swift -> Obj-C: return __kindof Something (From: Steve Christensen via Cocoa-dev <email@hidden>)

  • Prev by Date: Re: Swift -> Obj-C: return __kindof Something
  • Next by Date: Re: Thoughts on Objective-C++
  • Previous by thread: Re: Swift -> Obj-C: return __kindof Something
  • Next by thread: Re: Cocoa-dev Digest, Vol 16, Issue 144
  • Index(es):
    • Date
    • Thread