I try to present viewController(BrandViewController
) from view(MainCollectionViewCell.m
) by using didselectItemAt
method. So,
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
UIViewController *currentTopVC = [self currentTopViewController];
BrandViewController *brandVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"BrandVC"];
[currentTopVC presentViewController:brandVC animated:true completion:nil];
}
- (UIViewController *)currentTopViewController {
UIViewController *topVC = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
while (topVC.presentedViewController) {
topVC = topVC.presentedViewController;
}
return topVC;
}
This code shows BrandViewController
correctly, but I cannot click any buttons or images from BrandViewController
except my back button. Can you give me any ideas about this problem?
edited : I have two collectionViews. One is in MainViewController(MainCollectionView
), and the other is inside of MainCollectionViewCell
(didSelectItemAt
method called from here).
edited2: presented View hierarchy has two UITransitionView