开发者

How to get a reference to the current window?

开发者 https://www.devze.com 2022-12-31 21:27 出处:网络
Need a ref to the window in which a view is inside (no matter how deep inside). Usually there is only one window in an iPhone app. How would I access that the most easy wa开发者_运维百科y? Is there so

Need a ref to the window in which a view is inside (no matter how deep inside). Usually there is only one window in an iPhone app. How would I access that the most easy wa开发者_运维百科y? Is there something cooler than getting the app delegate to access the window?


To get a currently used window by your application use:

[[UIApplication sharedApplication] keyWindow]


Well, UIView has the window property...

0

精彩评论

暂无评论...
验证码 换一张
取 消