[self dismissViewControllerClass:NSClassFromString(@"HomeViewController")];
- (void)dismissViewControllerClass:(Class)class {
UIViewController *vc = self;
while (![vc isKindOfClass:class] && vc != nil) {
vc = vc.presentingViewController;
if ([vc isKindOfClass:[UINavigationController class]]) {
vc = ((UINavigationController *)vc).viewControllers.lastObject;
}
}
[vc dismissViewControllerAnimated:YES completion:nil];
}