Last active
August 29, 2015 14:25
-
-
Save toshi0383/2211089b7b7af71ddbc5 to your computer and use it in GitHub Desktop.
で、できた。。 #cswift #CodePiece
This file contains hidden or 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 UIKit | |
| protocol CustomViewControllerType { | |
| func hello() | |
| } | |
| extension CustomViewControllerType { | |
| func hello() { | |
| print("hello") | |
| } | |
| } | |
| extension ViewController : CustomViewControllerType { | |
| func hello() { | |
| (self as CustomViewControllerType).hello() | |
| print("yellow") | |
| } | |
| } | |
| class ViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Do any additional setup after loading the view, typically from a nib. | |
| hello() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment