the title says it all, i usually open ViewControllers like this
ListingViewController *listingView = [[ListingViewController alloc]init];
[self.navigationCon
self.navigationController can be accessed via only UIViewController's subclass. You want to access UINavigationController from not UIViewcontroller class. Is it what you are asking?
If you have property of UINavigationController at AppDelegate like
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) UINavigationController *navigationController;
@end
You can get a pointer from wherever you want as below
#import "AppDelegate.h"
AppDelegate *delegate = (AppDelegate *)[[[UIApplication sharedApplication] delegate];
UINavigationController *navigation = [delegate navigationController];
Now you have it.
You are looking to add detail views to a cell try this link on Adding Detail Views.Hopefully this Helps
You have to notify the ViewController, on cell click, on which UICollectionView exist. and on this controller you can push the desired controller
You need a view controller of some sort for pushing or presenting, there's no way around that.
You shouldn't have a problem accomplishing that and there are a few ways you can do so. First off, you should be able to write this logic in the UICollectionViewDelegate
method collectionView:didSelectItemAtIndexPath:
. Your delegate is most likely the containing view controller so that may be all you need to do. If however it isn't, just add a view controller property to your delegate that you can use for presenting things. Make it a weak one to avoid a possible retain cycle (where the view controller retains the delegate and the delegate retains the view controller).
Use the UICollectionViewDelegate method didSelectItemAtIndexPath for doing this and make sure that this delegate method is present in the view controller class implementing the UICollectionView.
You need to get the current UIViewController, there are multiple ways to do it. You can parse the VC in your UICollectionViewCell's header file. You can also use self.window.rootviewcontroller.
After that you can just use [VC pushViewController:listingView animated:YES]; or [self.window.rootviewcontroller pushViewController:listingView animated:YES];