One, the typical multi-view application
1, TAB BAR.
2,NAVIGATION BAR
3, Tab+navigation
4. TOOL BAR
Second, create a new multi-view app
1. App Effect Demo
2. Project Structure
bidswitchviewcontroller.m//View switcher////Created by Jason on 14-7-17.//Copyright (c) 2014 Jason. All rights reserved.//#import "BIDSwitchViewController.h" @interface Bidswitchviewcontroller () @end @implementation bidswitchviewcontroller-(ID) initwithnibname: (NSString *) Nibnameornil Bundle: (NSBundle *) nibbundleornil{self = [ Super Initwithnibname:nibnameornil Bundle:nibbundleornil]; if (self) {//Custom initialization} return to self;} -(void) viewdidload{[Super Viewdidload]; Do any additional setup after loading the view. Self.blueviewcontroller = [Self.storyboard instantiateviewcontrollerwithidentifier:@ "Blue"]; [Self.view InsertSubview:self.blueViewController.view atindex:0];} -(void) didreceivememorywarning{//Reclaim two sub-views [Super didreceivememorywarning]; Dispose of any resources the can be recreated. if (!self.blueviewcontroller.view.superview) {self.blueviewcontroller = nil; }else{Self.yellowviewcontroller = nil; }}/* #pragma mark-navigation//in a storyboard-based application, you'll often want to do a little preparation before n avigation-(void) Prepareforsegue: (Uistoryboardsegue *) Segue Sender: (ID) sender{//Get The new view controller using [SE Gue Destinationviewcontroller]. Pass the selected object to the new view Controller.} *///toggle Logic, toggle Animation-(ibaction) Switchviews: (ID) sender{[UIView beginanimations:@ "View Flip" context:null]; [UIView setanimationduration:0.4]; [UIView Setanimationcurve:uiviewanimationcurveeaseinout]; if (!self.yellowviewcontroller.view.superview) {if (!self.yellowviewcontroller) {Self.yellowviewcontro Ller = [Self.storyboard instantiateviewcontrollerwithidentifier:@ "Yellow"]; } [UIView Setanimationtransition:uiviewanimationtransitionflipfromright Forview:sel F.view Cache:yes]; [Self.blueViewController.view Removefromsuperview]; [Self.view InsertSubview:self.yellowViewController.view atindex:0]; }else{if (!self.blueviewcontroller) {self.blueviewcontroller = [Self.storyboard Instantiateviewcontrol lerwithidentifier:@ "Blue"]; } [UIView Setanimationtransition:uiviewanimationtransitionflipfromleft forview:self.v Iew Cache:yes]; [Self.yellowViewController.view Removefromsuperview]; [Self.view InsertSubview:self.blueViewController.view atindex:0]; } [UIView commitanimations];} @end
3, Code download:
https://github.com/Simba-Hu/View-Switcher.git
[email protected]: Simba-hu/view-switcher.git
Third, summary
View Controller
Storyboard
Uiviewcontroller
Empty Application
Toolbar
The Object Attributes Inspector
Control-drag
APP Delegate
Show Quick Help Inspector
Lazy Loading ,
Superview
Content views
Main.storyboard
Interface Builder
The Object library
Scene
Editor- align- horizontal Center incontainer
editor- align- verticalcenter in Container
The Connections Inspector
Touch up Inside Event
File ' Sowner icon
Background
The Attributes Inspector
The Identity Inspector
The Color picker
Constraints
Transition
"Beginning IOS 7 Development" proficient in iOS7 development "" Multiview applications