MOAspects
MOAspects copied to clipboard
I tried to hookInstanceMethodForClass at MOAspectsPosition.After in swift2, but method called before method call.
MOAspects.hookInstanceMethodForClass(SearchViewController.TableViewDelegateImpl.self, selector: "tableView:didSelectRowAtIndexPath:", position: MOAspectsPosition.After) { (obj:AnyObject?) -> Void in
someMethod1()
}
class SearchViewController : UIViewController {
class TableViewDelegateImpl : NSObject, UITableViewDelegate {
override dynamic func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
someMethod2()
}
}
I tried to hookInstanceMethodForClass at MOAspectsPosition.After in swift2 with Xcode7, but method called before method call. And this code was working right in swift1.2 with Xcode6.