On Dec 14, 2015, at 01:12 , dangerwillrobinsondan...@gmail.com wrote:
> 
> because it inherits from a class that conforms to the protocol

NSControl conforms informally (that is, it has the requisite methods) but not 
formally, which isn’t conformance in Swift terms. But there’s still a conflict 
between properties and methods, which seems to matter to the Swift compiler, 
that’s preventing subclasses from adopting conformance.

If you do this in a playground:

> import Cocoa
> extension NSControl : NSValidatedUserInterfaceItem { }


You get these error messages (plus more for ’tag’):

> error: type 'NSControl' does not conform to protocol 
> 'NSValidatedUserInterfaceItem'
> extension NSControl : NSValidatedUserInterfaceItem
> 
> AppKit.NSValidatedUserInterfaceItem:2:17: note: protocol requires function 
> 'action()' with type '() -> Selector'
>     public func action() -> Selector
>                 
> AppKit.NSControl:4:16: note: candidate is not a function
>     public var action: Selector { get set }

That pretty much lays out what the problem is, and as Luc

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to