class UICollectionView : UIScrollView
//初始化,位置,风格 
init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) //布局风格

var collectionViewLayout: UICollectionViewLayout

//代理

unowned(unsafe) var delegate: UICollectionViewDelegate?

//数据源

unowned(unsafe) var dataSource: UICollectionViewDataSource?

//背景视图

var backgroundView: UIView?

//注册cell
func registerClass(cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String)

func registerClass(viewClass: AnyClass?, forSupplementaryViewOfKind elementKind: String, withReuseIdentifier identifier: String)

func registerNib(nib: UINib?, forSupplementaryViewOfKind kind: String, withReuseIdentifier identifier: String)

func dequeueReusableCellWithReuseIdentifier(identifier: String, forIndexPath indexPath: NSIndexPath!) -> AnyObject

func dequeueReusableSupplementaryViewOfKind(elementKind: String, withReuseIdentifier identifier: String, forIndexPath indexPath: NSIndexPath!) -> AnyObject

 var allowsSelection: Bool // default is YES
var allowsMultipleSelection: Bool // default is NO
//返回被选中的items

func indexPathsForSelectedItems() -> [AnyObject] // returns nil or an array of selected index paths

//选中弄个indexpath, 是否有动画,

func selectItemAtIndexPath(indexPath: NSIndexPath?, animated: Bool, scrollPosition: UICollectionViewScrollPosition)

//取消选中

func deselectItemAtIndexPath(indexPath: NSIndexPath?, animated: Bool)

//刷新数据

func reloadData()

func setCollectionViewLayout(layout: UICollectionViewLayout, animated: Bool)


func setCollectionViewLayout(layout: UICollectionViewLayout, animated: Bool)

@availability(iOS, introduced=7.0)

func setCollectionViewLayout(layout: UICollectionViewLayout, animated: Bool, completion: ((Bool) -> Void)!)

@availability(iOS, introduced=7.0)

func startInteractiveTransitionToCollectionViewLayout(layout: UICollectionViewLayout, completion: UICollectionViewLayoutInteractiveTransitionCompletion?) -> UICollectionViewTransitionLayout

@availability(iOS, introduced=7.0)

func finishInteractiveTransition()

@availability(iOS, introduced=7.0)

func cancelInteractiveTransition()

//有几个

func numberOfSections() -> Int

//每个有多少行

func numberOfItemsInSection(section: Int) -> Int

func layoutAttributesForItemAtIndexPath(indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes?

func layoutAttributesForSupplementaryElementOfKind(kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes?

func indexPathForItemAtPoint(point: CGPoint) -> NSIndexPath?

func indexPathForCell(cell: UICollectionViewCell) -> NSIndexPath?

func cellForItemAtIndexPath(indexPath: NSIndexPath) -> UICollectionViewCell?

func visibleCells() -> [AnyObject]

func indexPathsForVisibleItems() -> [AnyObject]

//滚动到indespath位置

func scrollToItemAtIndexPath(indexPath: NSIndexPath, atScrollPosition scrollPosition: UICollectionViewScrollPosition, animated: Bool)


//插入

func insertSections(sections: NSIndexSet)

//删除
  func deleteSections(sections: NSIndexSet)
//重载弄个

func reloadSections(sections: NSIndexSet)

//移动

func moveSection(section: Int, toSection newSection: Int)

func performBatchUpdates(updates: (() -> Void)?, completion: ((Bool) -> Void)?)

 
extension NSIndexPath {

    init!(forItem item: Int, inSection section: Int) -> NSIndexPath

    @availability(iOS, introduced=6.0)
var item: Int { get }
}

UICollectionView的常用方法的更多相关文章

  1. iOS开发- UICollectionView详解+实例

    本章通过先总体介绍UICollectionView及其常用方法,再结合一个实例,了解如何使用UICollectionView. UICollectionView 和 UICollectionViewC ...

  2. iOS开发——UI篇OC篇&UICollectionView详解+实例

    UICollectionView详解+实例 实现步骤: 一.新建两个类 1.继承自UIScrollView的子类,比如HMWaterflowView * 瀑布流显示控件,用来显示所有的瀑布流数据 2. ...

  3. [转] iOS开发- UICollectionView详解+实例

    本章通过先总体介绍UICollectionView及其常用方法,再结合一个实例,了解如何使用UICollectionView. UICollectionView 和 UICollectionViewC ...

  4. iOS-UICollectionView

    1--------------------------------------------------------------------------------------------------- ...

  5. iOS-UICollectionView的简单使用(原创)

    前言 UICollectionView是一种新的数据展示方式,简单来说可以把他理解成多列的UITableView(请一定注意这是UICollectionView的最最简单的形式).如果你用过iBook ...

  6. iOS UICollectionView简单使用

    UICollectionView 和 UICollectionViewController 类是iOS6 新引进的API,用于展示集合视图,布局更加灵活,可实现多列布局,用法类似于UITableVie ...

  7. iOS流布局UICollectionView使用FlowLayout进行更灵活布局

    一.引言 前面的博客介绍了UICollectionView的相关方法和其协议中的方法,但对布局的管理类UICollectionViewFlowLayout没有着重探讨,这篇博客介绍关于布局的相关设置和 ...

  8. iOS UI-集合视图(UICollectionView)

    BowenCollectionViewCell.xib #import <UIKit/UIKit.h> @interface BowenCollectionViewCell : UICol ...

  9. UICollectionView的简单认识和简单实用

    摘要 UICollectionView是比UITableView更加复杂的UI控件,通过它可以实现许多复杂的流布局.但对我们来说,系统提供的接口十分简单易用,并且有十分强的制定性. iOS流布局UIC ...

随机推荐

  1. NO-CARRIER

    自己动手写了创建虚拟接口,删除虚拟接口程序,频繁调用创建删除时,有时将接口up起来时会报错: Name not unique on network 利用ip link命令来查看接口(及其对应的索引) ...

  2. 弹出框sweetalert插件的简单使用

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  3. Linux自动人机交互expect

    exp_test.sh文件 #!/bin/bash/expect ## exp_test.sh set timeout -; spawn ssh localhost; expect { "( ...

  4. CF 573B

    Bear and Blocks time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...

  5. python学习第7天

    编码的进阶 文件操作 深浅copy

  6. C语言-社保工资查询系统

    一.简述 此次程序没有涉及函数,完成工资.保险和住房公积金税前税后的查询.工资和社保公积金算法是依据最新的北京标准计算. 五险一金标准: 税率: 1.输入编号1~6查询保险,然后再选择是依据税前工资还 ...

  7. VBS猜数游戏

    VBS 猜数游戏 2018-11-09  21:19:11 by xutao msgbox "The Swami" ,,"Game" msgbox " ...

  8. 大数据python词频统计之hdfs分发-cacheArchive

    -cacheArchive也是从hdfs上进分发,但是分发文件是一个压缩包,压缩包内可能会包含多层目录多个文件 1.The_Man_of_Property.txt文件如下(将其上传至hdfs上) ha ...

  9. SQL Server 2012-2016-2017 简体中文版下载和序列号

    注:本文来源于<SQL Server 2012-2016-2017 简体中文版下载和序列号> SqlServer 2017 下载地址及密钥 下载地址:ed2k://|file|cn_sql ...

  10. Java的家庭记账本程序(A)

    日期:2019.2.1 博客期:028 星期五 其实我早就开始开发“家庭记账本”的软件了,只不过写博客写的有点晚,我是打算先做web的!因为Android Studio的教程,还是要对应版本,好多问题 ...