小知识 发表于 Jun 11 2018 小知识pragma mark - 获取当前view的viewcontroller123456789101112+ (UIViewController *)getCurrentViewController:(UIView *) currentView{for (UIView* next = [currentView superview]; next; next = next.superview){UIResponder *nextResponder = [next nextResponder];if ([nextResponder isKindOfClass:[UIViewController class]]){return (UIViewController *)nextResponder;}}return nil;}