Using Split View Controller and Navigation Controller As Window Root View Controller Alternately
Date : March 29 2020, 07:55 AM
will be helpful for those in need I finally found a way. I probably found the error. What i have done is cutting the branch on which i am sitting. I was releasing the view controller which i am currently in:) When viewdidDisappear called, there is no such view controller. Because i throw away it to space already.Below is my working steps. I hope it will be useful to someone. But i cant stand thinking of apple may reject my app. I wish finding a suitable way. This is my working ultimate way of using split view controller and navigation controller as window root view controller alternately. AppDelegate.h
@property (assign,nonatomic) UINavigationController * NC;
@property (assign,nonatomic) UISplitViewController *SVC;
AppDelegate.m
//Creating my main screen controller
//Creating my navigation controller with my view controller instance. Then
self.NC= my_navigation_controller;
self.window.rootViewController= self.NC;
MyMainScreen.m
-(void) OpenSplit()
{
//Creating my master view controller of SVC
//Creating my detail view controller of SVC
//Creating my SVC;
AppDelegate * app_delegate= [[UIApplication sharedApplication] delegate];
app_delegate.SVC= newly created my SVC;
app_delegate.window.rootViewController= app_delegate.SVC;
}
MyDetailView.m
- (void) viewDidLoad()
{
...
AppDelegate * app_delegate= [[UIApplication sharedApplication] delegate];
app_delegate.NC= nil; //i dont need it now. i am releasing. Releasing Navigation Controller release as well child controllers. I learned with testing.
}
MyDetailView.m
-(void) closeSplitView
{
//Creating navigation controller with my main screen view controller
AppDelegate * app_delegate= [[UIApplication sharedApplication] delegate];
app_delegate.NC= newly_created_NC;
app_delegate.window.rootViewController= appdelegate.NC;
}
MyMainScreen.m
-(void) viewDidLoad
{
AppDelegate * app_delegate= [[UIApplication sharedApplication] delegate];
app_delegate.SVC= nil; //I am releasing it because i am working with NC now.
}
|
How to return to view controller in main.storyboard from a xib without using navigation controller or navigation bar?
Tag : ios , By : harley.holt
Date : March 29 2020, 07:55 AM
should help you out Yes, you have to insert you called viewController to NavigationController, but if you wont to use modal flow - to close presentedViewController just call: [self dismissViewControllerAnimated:YES completion:^{
}];
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
UIViewController *c = [[UIViewController alloc] init];
c.view.backgroundColor = [UIColor redColor];
[self presentViewController:c animated:YES completion:^{
[self dismissViewControllerAnimated:YES completion:^{
}];
}];
}
|
Error trying to programmatically add a controller file to a navigation controller without creating storyboard
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , If you are not using a storyboard then you shouldn't attempt to create your sign-in view controller from a storyboard. Change the code to create the view controller directly: func SignIn(sender: UIButton!) {
print("I'm, here")
let controller = signInController()
self.navigationController?.pushViewController(controller, animated: true)
}
|
Storyboard's view controller not showing up when programmatically set as root view controller
Tag : ios , By : semicolonth
Date : March 29 2020, 07:55 AM
will be helpful for those in need You need to initialize the window programmatically. Try adding the following to the beginning of your didFinishLaunchingWithOptions method in Appdelegate self.window = UIWindow()
UIApplication.shared.windows.first?.rootViewController = rootVC
window?.rootViewController = rootVC
|
When set root view controller programmatically navigation and tab bar missing
Date : March 29 2020, 07:55 AM
|