现在的位置: 首页 > 综合 > 正文

通过UIView寻找UIViewController(Find UIViewController by UIView)

2013年09月19日 ⁄ 综合 ⁄ 共 620字 ⁄ 字号 评论关闭

UIView is a subclass of UIResponder. UIResponder lays out the method nextResponder with an implementation that returns nil. UIView overrides this method, as documented in UIResponder (for some reason instead of in UIView) as follows:
if the view has a view controller, it is returned by nextResponder. If there is no view controller, the method will return the superview.Add this to your project and you're ready to roll.

代码:

抱歉!评论已关闭.