- This project is written for custom collection view layout like sheet form
- In fact, many applications need to show view like sheet, so this project focus to make the collection view scrollable horizontal and vertical. The main feature is keep top and left dock
- iOS 8.0+
- Xcode 8.0
SSSheetLayout is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SSSheetLayout"
- Set collection view layout with custom type SSSheetLayout
- Set datasource for collection view layout (SSSheetLayout)
- How to change size for collection view cell
func collectionView(collectionView: UICollectionView, sizeForItem indexPath: IndexPath) -> CGSize {
if indexPath.row == 0 {
return CGSize(width: 100, height: 30)
}
return CGSize(width: 50, height: 30)
}
- How to keep dock when scroll to max, min offset
func scrollViewDidScroll(_ scrollView: UIScrollView) {
scrollView.keepDockOffset()
}
Ngô Đắc Du, ngodacdu92@gmail.com
SSSheetLayout is available under the MIT license. See the LICENSE file for more info.