Skip to content

Instantly share code, notes, and snippets.

@toshi0383
Last active August 29, 2015 14:25
Show Gist options
  • Select an option

  • Save toshi0383/2211089b7b7af71ddbc5 to your computer and use it in GitHub Desktop.

Select an option

Save toshi0383/2211089b7b7af71ddbc5 to your computer and use it in GitHub Desktop.
で、できた。。 #cswift #CodePiece
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