@implementation Appdelegate
-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchOptions {
Override point for customization after application launch.
SELF.HOMEVC = [[Homeviewcontroller alloc]init];
Uinavigationcontroller *navigation = [[Uinavigationcontroller ALLOC]INITWITHROOTVIEWCONTROLLER:SELF.HOMEVC];
Self.window.rootViewController = navigation;
return YES;
}
#import "HomeViewController.h"
@interface Homeviewcontroller ()
@end
@implementation Homeviewcontroller
-(void) loadview{
UIView *baseview = [[UIView alloc]initwithframe:[[uiscreen Mainscreen]applicationframe]];
Self.view = Baseview;
Baseview.backgroundcolor = [Uicolor Purplecolor];
}
-(void) Viewdidload {
[Super Viewdidload];
UIButton *button = [[UIButton alloc]initwithframe:cgrectmake (100, 100, 200, 40)];
Button.layer.cornerRadius = 8;
Button.backgroundcolor = [Uicolor Greencolor];
[Button settitle:@ "push" forstate:uicontrolstatenormal];
[Button addtarget:self action: @selector (PUSHTV) forcontrolevents:uicontroleventtouchupinside];
[Self.view Addsubview:button];
}
-(void) pushtv{
Uiviewcontroller *SECONDTV = [[Secondviewcontroller alloc]init];
Jump to sub page
[Self.navigationcontroller Pushviewcontroller:secondtv Animated:yes];
}
-(void) didreceivememorywarning {
[Super didreceivememorywarning];
}
@end
#import "SecondViewController.h"
@interface Secondviewcontroller ()
@end
@implementation Secondviewcontroller
-(void) Viewdidload {
[Super Viewdidload];
Do no additional setup after loading the view.
UIButton *button = [[UIButton alloc]initwithframe:cgrectmake (100, 100, 200, 40)];
Button.layer.cornerRadius = 8;
Button.backgroundcolor = [Uicolor Purplecolor];
[Button settitle:@ "second" forstate:uicontrolstatenormal];
[Button addtarget:self action: @selector (BACKTV) forcontrolevents:uicontroleventtouchupinside];
[Self.view Addsubview:button];
UIButton *savebtn = [[UIButton alloc]initwithframe:cgrectmake (125, 200, 150, 40)];
SaveBtn.layer.cornerRadius = 8;
Savebtn.backgroundcolor = [Uicolor Orangecolor];
[Savebtn settitle:@ "Save" forstate:uicontrolstatenormal];
[Savebtn addtarget:self Action: @selector (Saveclick) forcontrolevents:uicontroleventtouchupinside];
[Self.view ADDSUBVIEW:SAVEBTN];
}
-(void) backtv{
Navigation bar Hide
if (Self.navigationController.toolbarHidden) {
[Self.navigationcontroller Settoolbarhidden:no Animated:yes];
[Self.navigationcontroller Setnavigationbarhidden:no Animated:yes];
}else
{
[Self.navigationcontroller Settoolbarhidden:yes Animated:yes];
[Self.navigationcontroller Setnavigationbarhidden:yes Animated:yes];
}
}
-(void) saveclick{
Back to the main face
[Self.navigationcontroller Poptorootviewcontrolleranimated:yes];
}
-(void) didreceivememorywarning {
[Super didreceivememorywarning];
}
@end