I am posting a notification when app is coming to foreground state, I am observing notification in each and every view controller. How is the behaviour while observing? Which view controller will observe first and how it works?
Let me give an scenario: I have launched my application and went through the flow, now my app is going to background from the 4th ViewController and coming back to foreground state. Now Which view controller will observe first?
More Details: When I tried, i got the logs as below
2017-01-06 20:54:04.384 notificationCheck[607:7636] Observed in First ViewController
2017-01-06 20:54:04.384 notificationCheck[607:7636] Observed in First ViewController
2017-01-06 20:54:04.384 notificationCheck[607:7636] Observed in Second ViewController
2017-01-06 20:54:04.384 notificationCheck[607:7636] Observed in First ViewController
2017-01-06 20:54:04.385 notificationCheck[607:7636] Observed in Third ViewController
2017-01-06 20:54:04.385 notificationCheck[607:7636] Observed in First ViewController
2017-01-06 20:54:04.385 notificationCheck[607:7636] Observed in Fourth ViewController
How this is happening and what was reason for this? Why the notification is observed many times in firstviewcontroller?Click here to see the code