UICollectionView
public extension UICollectionView
-
注册Cell(Nib)
Declaration
Swift
func registerNib<T>(_ cell: T.Type, bundle: Bundle? = nil) where T : UICollectionViewCellParameters
cellcell类型
-
注册Cell
Declaration
Swift
func register<T>(_ cell: T.Type) where T : UICollectionViewCellParameters
cellcell类型
-
获取Cell
Declaration
Swift
func get<T>(_ cell: T.Type, for indexPath: IndexPath) -> T where T : UICollectionViewCellParameters
cellcell类型
indexPathindexPath
Return Value
cell实例
-
注册Header或者Footer(Nib)
Declaration
Swift
func register<T>(_ cls: T.Type, kind: String) where T : UICollectionReusableViewParameters
clsHeader或者Footer类型
kindheader还是footer
- UICollectionView.elementKindSectionHeader
- UICollectionView.elementKindSectionFooter
-
注册Header或者Footer
Declaration
Swift
func registerNib<T>(_ cls: T.Type, kind: String, bundle: Bundle? = nil) where T : UICollectionReusableViewParameters
clsHeader或者Footer类型
kindheader还是footer
- UICollectionView.elementKindSectionHeader
- UICollectionView.elementKindSectionFooter
-
获取Header或者Footer
Declaration
Swift
func get<T>(_ cls: T.Type, kind: String, for indexPath: IndexPath) -> T where T : UICollectionReusableViewParameters
clsHeader或者Footer类型
kindheader还是footer
- UICollectionView.elementKindSectionHeader
- UICollectionView.elementKindSectionFooter
indexPathindexPath
Return Value
Header或者Footer实例
View on GitHub
Install in Dash
UICollectionView Extension Reference