View Controller的组合应用其实很常见了,比如说Tab bar controller和Navigation view controller的组合使用,像这种一般都是Navigation view controller作为Tab bar controller的一个child view controller,对应了一个Tab bar item. 然后今天在Review 另外一组的一个产品的代码时,发现他们将Tab bar controller作为了一个普通view controller的…
原文链接 : Introduction to Custom View Controller Transitions and Animations 原文作者 : joyce echessa 译文出自 : 开发技术前线 www.devtf.cn 译者 : kmyhy 观察 iOS 自带的 App,你会看到当你从一个视图导航到还有一个视图时总是会显示各种各样的转换动画,以"主-从"视图为例(相似的程序有Messages App或者系统设置程序),一个轻扫动作能够让详情视图呈如今主视图之上,在…
Present ViewController详解 Present ViewController Modally 一.主要用途 弹出模态ViewController是IOS变成中很有用的一个技术,UIKit提供的一些专门用于模态显示的ViewController,如UIImagePickerController等.弹出模态ViewController主要使用于一下这几种情形: 1.收集用户输入信息 2.临时呈现一些内容 3.临时改变工作模式 4.相应设备方向变化(用于针对不同方向分别是想两个Vie…
1.View Controller 基础 1.1 View Controller 分类 ViewController分为container view controller 和content view controller两种类型. 这两种类型只是用途不同,前者作为一个容器容纳其他的view controller,后者用来显示内容,代码上面区别不大.前者包括UINavigationViewController. UITabBarViewController等,后者包括UITabViewContro…
View Controller Basics   视图控制器基础 Apps running on iOS–based devices have a limited amount of screen space for displaying content and therefore must be creative in how they present information to the user. Apps that have lots of information to display…
一.UIViewController 做iOS开发的经常会和UIViewController打交道,从类名可知UIViewController属于MVC模型中的C(Controller),说的更具体点它是一个视图控制器,管理着一个视图(view). UIViewController的view是lazy loading的,当你访问其view属性的时候,view会从xib文件载入或者通过代码创建(覆盖loadView方法,自定义其view hierarchy),并返回,如果要判断一个View Con…
MVC框架 同义词 MVC一般指MVC框架 MVC全名是Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写,一种软件设计典范,用一种业务逻辑.数据.界面 显示分离的方法组织代码,将业务逻辑聚集到一个部件里面,在改进和个性化定制界面及用户交互的同时,不需要重新编写业务逻辑.MVC被独特的发展起来用于 映射传统的输入.处理和输出功能在一个逻辑的图形化用户界面的结构中. 简介 MVC开始是存在于桌面程序中的,M是指业务模型,V是指用…
Resizing the View Controller’s Views A view controller owns its own view and manages the view’s contents. In the process, the view controller also manages the view’s subviews. But in most cases, the view’s frame is not set directly by the view contro…
View Controller Basics Apps running on iOS–based devices have a limited amount of screen space for displaying content and therefore must be creative in how they present information to the user. Apps that have lots of information to display must there…
About View Controllers View controllers are a vital link between an app’s data and its visual appearance. Whenever an iOS app displays a user interface, the displayed content is managed by a view controller or a group of view controllers coordinating…
这个问题是什么意思呢,之前遇到过几次,但程序再次打开时没有问题,也就没有重视,今天又遇到了,无法忍受啊. 控制台报的错误是:"不支持多次推入相同的视图控制器实例". 什么原因造成的呢? 提示了LoginViewController  .在进入这个页面的时候,有多次重复push操作.具体什么原因,在一个控制器里有多次执行push进同一个控制器的操作. 昨天没有时间深究具体在哪发生了这个操作,今天来理理. a)首先,在程序里加上一个全局的异常断点(我这样叫它) 加上一个 b)然后就是运行程…
前言 古老的MVC架构是容易被iOS开发者理解和接受的设计模式,但是由于iOS开发的项目功能越来越负责庞大,项目代码也随之不断壮大,MVC的模糊定义导致我们的业务开发工程师很容易把大量的代码写到视图控制器中,行业中对这种控制器有个专业词汇Massive ViewControler(臃肿的视图控制器).代码臃肿导致可读性可维护性差,而且这种不清晰的设计还有许多的副作用,比如代码重用性差.作为架构师需要关注项目的代码质量.指导业务开发工程师写出高质量,高健壮性,高可用的代码也是很重要的工作.因此需要…
转载地址:http://blog.sina.com.cn/s/blog_6784e6ea01017jfy.html 最新更正:这个提示几乎不影响编译和运行,可以不用设置.     产生这个提示的操作:在xcode4.6中创建一个名字为appTest空工程,create一个ios-application-empty application,直接编译运行   错误提示:虽然编译通过,也能运行,但是底下有错误提示“application windows are expected to have a r…
MVC模式(Model View Controller): Model:DAO模型 View:JSP  在页面上填写java代码实现显示 Controller:Servlet 重定向和请求的转发: 若目标的相应页面不需要从request里面读取任何信息,则可以使用重定向,可以防止表单重复提交: ------------------------------------------------------------------------------------------------ Stude…
在iOS5和iOS6前,View Controller的切换主要有4种: 1. Push/Pop,NavigationViewController常干的事儿 2. Tab,TabViewController点击 3. Present Modal,调用ViewController的presentViewController:animated:completion:方法 4. Add ChildViewController,调用- (void)addChildViewController:(UIVi…
今天在点击按钮push viewController 时,控制台报错: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing the same view controller instance more than once is not supported 网上查了以下原因, 是说过快点击可能会产生多次push的情况,在MVC里是不支持这种事件的,所以,保险起见,在可能出现…
产生这个提示的操作:在xcode4.6中创建一个名字为appTest空工程,create一个ios-application-empty application,直接编译运行 错误提示:虽然编译通过,也能运行,但是底下有错误提示“application windows are expected to have a root view controller” 原因:在较新的xcod上都会出现这种错误.在iOS5之前的版本,应用加载时,需要一个root view controller,在iOS5以下的…
之前用objective-c开发时,页面之间的切换很容易.其实用swift没有很大的变化,如果你是用storyboard完成的界面,基本上是同样的方式,只不过在代码部分写成swift风格的就行了. 今天在实验开发一个简单的小程序时,却遇到了一些bug,后来还是求助stackoverflow上的大神解决了问题,在此做下记录. 我的程序结构是这样的,在一个页面A中有个按钮,然后点击按钮以后,切换到另一个页面B.A和B都在同一个storyboard中. 这里先说下通用的方法: 手动用代码建好的view…
在iOS中,不同的视图控制器负责不同的功能,采用不同的风格向用户呈现信息.下面对各个视图控制器做个总结: 1,标准视图控制器 - View Controller 这个控制器只是用来呈现内容.通常会用来作为子类,以向屏幕中添加逻辑. 2,导航控制器 - Navigation Controller 这个控制器呈现一个视图控制器的栈,应用程序可以在上面推入更多的视图控制器. 当新视图推入栈,或旧视图弹出栈时,导航控制器会以动画的形式(比如卷动)显示隐藏这些视图. 使用样例:系统“设置”应用程序 3,表…
iOS 容器控制器 (Container View Controller) 一个控制器包含其他一个或多个控制器,前者为容器控制器 (Container View Controller),后者为子控制器 (Child View Controller).UINavigationController.UITabBarController 是常用的容器控制器.本文介绍自定义容器控制器的方法. 自定义容器控制器 添加子控制器 - (void)displayContentController:(UIView…
冬天已经过去了,阳光越来越暖洋洋的了.还记得上学的时候,老师总说"春天是播种的季节",而我还没在朋友圈许下什么愿望.一年了,不敢想象回首还能看到点什么,所以勇往直前.当被俗世所扰,你是否也丢失了自己,忘却了理想. 欲做精金美玉的人品,定从烈火中煅来:思立掀天揭地的事功,须向薄冰上履过. 这篇博客中,我们主要来叙述一下上述动画效果的实现方案.主要涉及 View Controller 转场动画的知识.我搭建了个人站点,那里有更多内容,请多多指教.点我哦!!! Presenting a Vi…
在DRP中终于接触到了MVC,感触是确实这样的架构系统灵活性不少,现在感触最深的就是使用tomcat作为服务器发布比IIS好多了,起码发布很简单,使用起来方便. 首先来简单的学习一下MVC的基础知识,MVC全名是Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写,一种软件设计典范,用一种业务逻辑和数据显式分离的方法组织代码,将业务逻辑被聚集到一个部件里面,在界面和用户围绕数据的交互能被改进和个性化定制的同时而不需要重新编写业务…
在写iOS程序时,view controller的显示大小以及控件大小的调节是在是一个费力的事,尤其是对于用mac本的童鞋,更难驾驭,这时我们可以根据需要设置专门针对iphone或者ipad的view controller的大小,可以修改设置项“Use Size Classes": 当选中时:view controller能同时适用iPhone和ipad的尺寸 未选中时:有提示框来指导是用iPhone的尺寸还是ipad得尺寸,运行时会根据选择的simulator变化…
在 iOS 5 之前,view controller 容器是 Apple 的特权.实际上,在 view controller 编程指南中还有一段申明,指出你不应该使用它们.Apple 对 view controllers 的总的建议曾经是“一个 view controller 管理一个全屏幕的内容”.这个建议后来被改为“一个 view controller 管理一个自包含的内容单元”.为什么 Apple 不想让我们构建自己的 tab bar controllers 和 navigation co…
參考文章来自objcio站点   为什么要编写轻量级的View Controller??   1.作为iOS项目中最大的文件,ViewControllers中的代码复用率差点儿是最低的 2.重量级的View COntroller加大了測试的复杂度.   所以关注ViewController的瘦身.把业务逻辑.网络请求.Views的代码移到合适的地方.进而提高代码可读性.减少耦合.提高复用.减少測试难度极为重要   一.把DataSource和其它Protocols分离出来     比方uiTab…
1. UITextView @property(nonatomic,readonly,retain) NSTextStorage *textStorage 是 NSMutableAttributedString 的子类 [self.body.textStorage addAttributes:@{ NSStrokeWidthAttributeName : @-3, NSStrokeColorAttributeName : [UIColor blackColor]} range:self.body…
Using View Controllers in the Responder Chain 响应链中使用视图控制器 View controllers are descendants of the UIResponder class and are therefore capable of handling all sorts of events. When a view does not respond to a given event, it passes that event to its…
Responding to Display-Related Notifications 响应跟显示相关的通知 When the visibility of a view controller’s view changes, the view controller calls some built-in methods to notify subclasses of the changes. You can override these methods to override how your s…
Resource Management in View Controllers View controllers are an essential part of managing your app’s resources. View controllers allow you to break your app up into multiple parts and instantiate only the parts that are needed. But more than that, a…
Creating Custom Content View Controllers 创建自定义内容视图控制器 Custom content view controllers are the heart of your app. You use them to present your app’s unique content. All apps need at least one custom content view controller. Complex apps divide the wor…