Skip to content

This project is written for custom collection view layout like sheet form

License

Notifications You must be signed in to change notification settings

ngodacdu/SSSheetLayout

Repository files navigation

SSSheetLayout

CI Status Version License Platform

  • 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

Screen shot

Requirements

  • iOS 8.0+
  • Xcode 8.0

Installation

SSSheetLayout is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "SSSheetLayout"

Usage

  1. Set collection view layout with custom type SSSheetLayout

Change layout type

  1. Set datasource for collection view layout (SSSheetLayout)

Set Datasource

  1. 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)
}
  1. How to keep dock when scroll to max, min offset
func scrollViewDidScroll(_ scrollView: UIScrollView) {
    scrollView.keepDockOffset()
}

Author

Ngô Đắc Du, ngodacdu92@gmail.com

License

SSSheetLayout is available under the MIT license. See the LICENSE file for more info.

About

This project is written for custom collection view layout like sheet form

Resources

License

Stars

Watchers

Forks

Packages