SSSheetLayout 1.0.0

SSSheetLayout 1.0.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jun 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Ngo Dac Du.




  • By
  • Ngô Đắc Du

SSSheetLayout

  • 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

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

  2. Set datasource for collection view layout (SSSheetLayout) Set Datasource

  3. 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, [email protected]

License

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