Showing posts with label ViewController related.... Show all posts
Showing posts with label ViewController related.... Show all posts

24 Jun 2017

To Present , Dismiss & Push, Pop viewControllers...


To Present , Dismiss & Push, Pop viewControllers...


// To present VC
ViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController"];
  controller.typeString=@"toNextVC"; // type string to pass something
[self presentViewController:controller animated:YES completion:nil];

// To dissmiss VC
 [self dismissViewControllerAnimated:YES completion:nil];
           

// To push VC
ViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController"];
  controller.typeString=@"toNextVC";  // type string to pass something

[self.navigationController pushViewController:controller animated:YES];

// To pop VC
 [self.navigationController popViewControllerAnimated:YES];

2 Jan 2017

VIewController instantiation PushViewController(With NavigationController)...

when we want use one viewController in another viewController first we have to instantiate that we controller with identifier in presentViewController.(first import view controller in present file and then fallow below code.)
now we can use for accessing variables of viewController in presentviewController and we can push the viewcontroller from present viewController.


{

DataTableViewController *viewC = [self.storyboard instantiateViewControllerWithIdentifier:@"DataTableViewControllerID"];
viewC.array1=self.array2;

       [self.navigationController pushViewController:viewC animated:YES];

}

Recent Posts

Codable demo

Link: https://www.dropbox.com/s/kw7c1kgv1628bh7/codableDemo.zip?dl=0