func getViewController() -> UIViewController? {
for view in sequence(first: self.superview, next: {$0?.superview}){
if let responder = view?.next{
if responder.isKind(of: UIViewController.self){
return responder as? UIViewController
}
}
}
return nil
}
网友评论