Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#import "ViewController.h"
@interface ViewController (){
UIViewController *anotherView;
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSLog(@"viewDidLoad is running");
anotherView = [UIViewController new];
anotherView.view.backgroundColor = [UIColor redColor];
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
NSLog(@"viewWillAppear is running");
NSLog(@"viewDidAppear is running");
[super viewWillDisappear:animated];
NSLog(@"viewWillDisappear is running");
NSLog(@"viewDidDisappear is running");
- (IBAction)onClickBtn:(id)sender {
[self presentViewController:anotherView animated:YES completion:nil];
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.