You have 2 problems:
- You post the notification before anyone is registered to receive it.
- When adding the observer you filter to an instance that doesn't post a notification (
object:self.viewController
).
For 1. Notifications aren't stored, they are received only by observers attached when the notification is posted.
For 2. Notifications can be posted with an object and observers can filter on that object. If the objects don't match the method won't be called. Set the object to nil when observing if you don't want any filtering done.
Swap the order of your view controller presentation and the notification posting:
ViewController2 *viewController2 = [self.storyboard instantiateViewControllerWithIdentifier:@"viewController2"];
[self presentViewController:viewController2
animated:YES
completion:^{
[[NSNotificationCenter defaultCenter] postNotificationName:@"networkNotification"
object:nil];
}