Using the Flow Layout使用流布局 The UICollectionViewFlowLayout class is a concrete layout object that you can use to arrange items in your collection views. The flow layout implements a line-based breaking layout, which means that the layout object plac…
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…
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…
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…
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…