温馨提示×

IOS 响应事件传递nextResponder

发布时间:2020-06-26 00:44:31 来源:网络 阅读:916 作者:李远超0317 栏目:移动开发

官方解释

UIView implements this method by returning the UIViewController object that manages it (if it has one) or its superview (if it doesn’t); UIViewController implements the method by returning its view’s superview; UIWindow returns the application object, and UIApplication returns nil.

id next = [self nextResponder];
while(![next isKindOfClass:[ViewController class]]) {
    next = [next nextResponder];
}
if ([next isKindOfClass:[ViewController class]]) {
    controller = (ViewController *)next;
}


免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。