swift3.0通过响应链获取当前试图的控制器
func parentViewController() -> UIViewController? {
let n = next
while n != nil {
let controller = next?.next
if (controller is UIViewController) {
return controller as? UIViewController } }
return nil
}
func parentViewController() -> UIViewController? {
let n = next
while n != nil {
let controller = next?.next
if (controller is UIViewController) {
return controller as? UIViewController } }
return nil
}