Skip to content

Instantly share code, notes, and snippets.

@JeOam
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeOam/cdaadae85490fd0f1220 to your computer and use it in GitHub Desktop.
Save JeOam/cdaadae85490fd0f1220 to your computer and use it in GitHub Desktop.
[[UIApplication sharedApplication] keyWindow]

查找应用程序的主窗口对象。一般情况就是 UIWindow

当然一个应用程序可以有多个 window,键盘是一个 window

[[UIApplication sharedApplication] keyWindow]就是查找当前应用程序的主 window。

via :here

@JeOam
Copy link
Author

JeOam commented May 29, 2014

[[UIApplication sharedApplication] delegate] will give you a pointer to your app delegate. the one that was automatically created when you made the project. Usually it's named YourAppNameAppDelegate.

via: here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment