xcode 报错
whose view is not in the window hierarchy!
也就是你现在的Present的视图并不是Windows视图
///获取当前控制器
func currentVc() ->UIViewController{
var vc = UIApplication.shared.keyWindow?.rootViewController
if (vc?.isKind(of: UITabBarController.self))! {
vc = (vc as! UITabBarController).selectedViewController
}else if (vc?.isKind(of: UINavigationController.self))!{
vc = (vc as! UINavigationController).visibleViewController
}else if ((vc?.presentedViewController) != nil){
vc = vc?.presentedViewController
}
return vc!
}
1万+



被折叠的 条评论
为什么被折叠?



