Is this possible in iOS, or do I really have to register a shake event detection in every single view controller?

I want that a user of my app can shake his iPhone to return to the root. Regardless of the current view controller.