pragma mark - 获取当前view的viewcontroller
+(UIViewController *)getCurrentViewController:(UIView *) currentView
{
if (currentView && [currentView isKindOfClass:[UIView class]])
{
for (UIView* next = currentView; next&&[next isKindOfClass:[UIView class]]; next = next.superview)
{
UIResponder *nextResponder = [next nextResponder];
if ([nextResponder isKindOfClass:[UIViewController class]])
{
return (UIViewController *)nextResponder;
}
}
}
return nil;
}