资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

[IOS]SettingBundle+StoryBoard

用storyboard添加一个导航栏,其中首页有一个switch,与setting联动,还有一个button,使用modal连接另一个viewControl,其上也有一个按钮,按下销毁本viewControl,回到前一页。

实现步骤:

1.创建一个SingleView的项目,勾选上storyboard。

2.向storyboard中添加一个NavigationController,两个ViewController,然后在NavigationController中右击指向第一个ViewController,然后设置为rootViewController,并且将箭头指向NavigationController。

3.将两个ViewController的Class分别设置为DXWViewController和DXWViewController1(两个自己创建的类,继承自ViewController)

4.创建setting文件,并将root.plist保存一个键值对,key改成switch

5.修改DXWViewController(主视图)

[IOS]Setting Bundle + StoryBoard

DXWViewController.h:

#import  @class DXWViewController1;  @protocol DXWFlipsideViewControllerDelegate - (void)flipsideViewControllerDidFinish:(DXWViewController1 *)controller; @end @interface DXWViewController1 : UIViewController @property (assign, nonatomic) id  delegate; - (IBAction)done:(id)sender; @end

DXWViewController.m:

#import "DXWViewController1.h"  @interface DXWViewController1 ()  @end  @implementation DXWViewController1  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {     self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];     if (self) {         // Custom initialization     }     return self; }  - (void)viewDidLoad {     [super viewDidLoad]; 	// Do any additional setup after loading the view. }  - (void)didReceiveMemoryWarning {     [super didReceiveMemoryWarning];     // Dispose of any resources that can be recreated. }  - (IBAction)done:(id)sender {     [self.delegate flipsideViewControllerDidFinish:self]; } @end





分享题目:[IOS]SettingBundle+StoryBoard
转载来于:http://cdkjz.cn/article/jgsppi.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220