johnno1962 / injectionforxcode

Runtime Code Injection for Objective-C & Swift
MIT License
6.55k stars 566 forks source link

UIViewController viewDidLoad, viewWillAppear, viewDidAppear #15

Closed tomashanacek closed 10 years ago

tomashanacek commented 10 years ago

Hi, is there possibility call viewDidLoad, viewWillAppear, viewDidAppear at injection UIViewController (without storyboard and nib...)?

Thank you!

bimawa commented 10 years ago

yes but not direcly. After injection it post notification kINNotification you can cacth it and manualy reload viewController [[NSNotificationCenter defaultCenter] addObserverForName:kINNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { //[self.tableView setTableHeaderView:[[GFStreamChatTextInputView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 50)]]; [self.tableView reloadData]; }];

tomashanacek commented 10 years ago

Thank you for response. I love injection!