#import "ViewController.h" #import "OneViewController.h" #import "TwoViewController.h" @interface ViewController () @property (nonatomic, strong) UISegmentedControl *segmentedControl; @property (nonatomic, strong) UIViewContr…
前言 苹果在iOS 7以后给导航控制器增加了一个Pop的手势,只要手指在屏幕边缘滑动,当前的控制器的视图就会跟随你的手指移动,当用户松手后,系统会判断手指拖动出来的大小来决定是否要执行控制器的Pop操作. nav_pop_origin.gif 这个操作的想法非常好,但是系统给我们规定的范围必须是屏幕左侧边缘才可以触发,这样实际使用过程中对于有些产品会产生不便,于是有些app就采取整个屏幕都响应这个手势并且pop动画还是用系统原生的,这样操作起来确实方便好多. nav_pop_custom.gif…
一.pickerView简单使用 1.UIPickerViewDataSource 这两个方法必须实现 // 返回有多少列 - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView; // 返回第component有多少行 - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component;…
建三个UIViewController 的子控制器,其中一个为根控制器,另外两个控制器的视图作为切换对象 AppDelegate中代码 //AppDelegate.h中代码 #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (retain, nonatomic) UIWindow *window; @end //AppDelegate.m中代码…
iOS 容器控制器 (Container View Controller) 一个控制器包含其他一个或多个控制器,前者为容器控制器 (Container View Controller),后者为子控制器 (Child View Controller).UINavigationController.UITabBarController 是常用的容器控制器.本文介绍自定义容器控制器的方法. 自定义容器控制器 添加子控制器 - (void)displayContentController:(UIView…
前言 古老的MVC架构是容易被iOS开发者理解和接受的设计模式,但是由于iOS开发的项目功能越来越负责庞大,项目代码也随之不断壮大,MVC的模糊定义导致我们的业务开发工程师很容易把大量的代码写到视图控制器中,行业中对这种控制器有个专业词汇Massive ViewControler(臃肿的视图控制器).代码臃肿导致可读性可维护性差,而且这种不清晰的设计还有许多的副作用,比如代码重用性差.作为架构师需要关注项目的代码质量.指导业务开发工程师写出高质量,高健壮性,高可用的代码也是很重要的工作.因此需要…
一.导航控制器出栈 1.initWithRootViewController本质 UIViewController *vc = [[OneViewController alloc] init]; // 创建导航控制器 // 导航控制器必须要有一个根控制器 UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc]; // 会调用push方法 // initWithRoot…
iOS开发UI篇—控制器的View的创建 一.6种创建控制器View的方式 #import "NJAppDelegate.h" #import "NJViewController.h" /* 1.没有同名xib情况下 2.通过 storyboard 创建 3.有指定xib情况下创建 4.有同名xib情况 5.有同名去掉controll的情况 6.loadveiw */ @implementation NJAppDelegate - (BOOL)application…
*:first-child { margin-top: 0 !important; } body > *:last-child { margin-bottom: 0 !important; } a { color: #4183C4; } a.absent { color: #cc0000; } a.anchor { display: block; padding-left: 30px; margin-left: -30px; cursor: pointer; position: absolute…
最近对view的周期等还不是非常清楚,就找到顶哥的文章,非常不错,就搬运过来了. 原文: http://www.cnblogs.com/wendingding/p/3770760.html 一.6种创建控制器View的方式 1 #import "NJAppDelegate.h" 2 #import "NJViewController.h" 3 /* 4 1.没有同名xib情况下 5 2.通过 storyboard 创建 6 3.有指定xib情况下创建 7 4.有同名…