Last active
August 11, 2016 08:30
-
-
Save conscientiousness/b090ea70af873e66cdfdb71d045e0122 to your computer and use it in GitHub Desktop.
extension Selector
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
// in self class -> MyVC | |
myBtn.addTarget(self, action: .selfSelector, forControlEvents: .TouchUpInside) | |
// in singleton class -> mainVC | |
mainVCBtn.addTarget(SingletonClass.shared().mainVC, action: .addTopicSelector, forControlEvents: .TouchUpInside) | |
private extension Selector { | |
static let selfSelector = #selector(MyVC.btnDidPressed(_:)) | |
static let addTopicSelector = #selector(SingletonClass.shared().mainVC.newTopicBtnPressed(_:)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment