iOS Get TopView

How to get top view.
If you want to add something to the top view.(at the top), you need to get top view reference.
How to do that?

Code

[[[UIApplication sharedApplication] keyWindow] addSubview:yourview];

This is the top view. Ignore any hierarchy.