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…
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…
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…
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…
Using View Controllers in Your App Whether you are working with view controllers provided by iOS, or with custom controllers you’ve created to show your app’s content, you use a similar set of techniques to actually work with the view controllers. 不管…
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…
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…
1.View Controller 基础 1.1 View Controller 分类 ViewController分为container view controller 和content view controller两种类型. 这两种类型只是用途不同,前者作为一个容器容纳其他的view controller,后者用来显示内容,代码上面区别不大.前者包括UINavigationViewController. UITabBarViewController等,后者包括UITabViewContro…
Views Because view objects are the main way your application interacts with the user, they have many responsibilities. Here are just a few: 因为视图对象是应用程序跟用户交互的主要方式,所以它们有很多责任.以下是其中一小部分: Layout and subview management 布局和子视图管理 A view defines its own defau…
View and Window Architecture 视图和窗口架构 Views and windows present your application’s user interface and handle the interactions with that interface. UIKit and other system frameworks provide a number of views that you can use as-is with little or no mod…
原文:View Programming Guide for iOS View and Window Architecture Views and windows present your application’s user interface and handle the interactions with that interface. UIKit and other system frameworks provide a number of views that you can use a…
  Animations Animations provide fluid visual transitions between different states of your user interface. In iOS, animations are used extensively to reposition views, change their size, remove them from view hierarchies, and hide them. You might use…
Next About Windows and Views 关于窗口和视图 In iOS, you use windows and views to present your application’s content on the screen. Windows do not have any visible content themselves but provide a basic container for your application’s views. Views define a…
Windows Every iOS application needs at least one window—an instance of the UIWindow class—and some may include more than one window. A window object has several responsibilities: 每个iOS应用程序需要至少一个窗口---UIWindow类的一个实例---有些可能有不止一个窗口.窗口对象的任务是: It contains…
The frame property contains the frame rectangle, which specifies the size and location of the view in its superview’s coordinate system. frame是指定父视图的位置和大小的 The bounds property contains the bounds rectangle, which specifies the size of the view (and i…
frame—Use this to animate position and size changes for the view.  ,框架,可以视图动态改变大小和位置 bounds—Use this to animate changes to the size of the view.      ,可以改变视图的大小 center—Use this to animate the position of the view.           ,可以改变视图的位置 transform—Use t…
https://developer.apple.com/library/archive/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/WindowsandViews/WindowsandViews.html#//apple_ref/doc/uid/TP40009503-CH2-SW42…
About Table Views in iOS Apps Table views are versatile user interface objects frequently found in iOS apps. A table view presents data in a scrollable list of multiple rows that may be divided into sections. 表格视图是通用用户界面对象,常常能在iOS应用程序里看到. 表格视图在一个多行的一…
原文:View Programming Guide for iOS 1 Introduction 先熟悉一下基本概念. Window Windows do not have any visible content themselves but provide a basic container for your application's views. Every application has at least one window that displays the application'…
Navigating a Data Hierarchy with Table Views 导航数据表视图层次 A common use of table views—and one to which they’re ideally suited—is to navigate hierarchies of data. A table view at a top level of the hierarchy lists categories of data at the most general l…
Next About iOS Collection Views 关于iOS Collection Views A collection view is a way to present an ordered set of data items using a flexible and changeable layout. The most common use for collection views is to present items in a grid-like arrangement,…
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…
  Designing Your Data Source and Delegate 设计你的数据源和委托 Every collection view must have a data source object providing it with content to display. The data source object is an object that your app provides. It could be an object from your app’s data mod…
iOS 7 UI Transition Guide Preparing for Transition Before You Start Scoping the Project Supporting iOS 6 Updating the UI Appearance and Behavior Bars and Bar Buttons Content Views Controls Temporary Views Supporting iOS 6 If business reasons require…
一.UIViewController 做iOS开发的经常会和UIViewController打交道,从类名可知UIViewController属于MVC模型中的C(Controller),说的更具体点它是一个视图控制器,管理着一个视图(view). UIViewController的view是lazy loading的,当你访问其view属性的时候,view会从xib文件载入或者通过代码创建(覆盖loadView方法,自定义其view hierarchy),并返回,如果要判断一个View Con…
Custom Layouts: A Worked Example Creating a custom collection view layout is simple with straightforward requirements, but the implementation details of the process may vary. Your layout must produce layout attributes objects for every view your coll…
Creating and Configuring a Table View Your app must present a table view to users before it can manage it in response to taps on rows and other actions. This chapter shows what you must do to create a table view, configure it, and populate it with da…
Managing Selections 管理选择 When users tap a row of a table view, usually something happens as a result. Another table view could slide into place, the row could display a checkmark, or some other action could be performed. The following sections descri…
  Incorporating Gesture Support 结合手势支持 You can add greater interactivity to your collection views through the use of gesture recognizers. Like any view, you can add a gesture recognizer to a collection view and use it to trigger actions when those ge…