public class Cat { // Auto-implemented properties. public int Age { get; set; } public string Name { get; set; } public Cat() { } public Cat(string name) { this.Name = name; } } var moreNumbers = new Dictionary<int, string>{ {19, "nineteen"…
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…
  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…
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,…
Creating Custom Layouts 创建自定义布局 Before you start building custom layouts, consider whether doing so is really necessary. The UICollectionViewFlowLayout class provides a significant amount of behavior that has already been optimized for efficiency and…
  Collection View Basics Collection View 基础 To present its content onscreen, a collection view cooperates with many different objects. Some objects are custom and must be provided by your app. For example, your app must provide a data source object t…
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…
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…
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…
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…