Created
January 11, 2015 00:39
-
-
Save kongtomorrow/43f4b319a2f14c5fe48f to your computer and use it in GitHub Desktop.
protocol and class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
protocol MyProtocol { | |
func myFunc() | |
} | |
class MyView : NSView, MyProtocol { | |
func myFunc() { | |
} | |
} | |
func takeVConformingToViewAndProtocol<T: NSView where T : MyProtocol>(v:T) { | |
v.myFunc() | |
println(v.subviews) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment