- Notifications
You must be signed in to change notification settings - Fork30
A UICollectionViewLayout subclass displays its items as rows of items similar to the App Store Feature tab without a nested UITableView/UICollectionView hack.
License
pitiphong-p/CollectionViewShelfLayout
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A UICollectionViewLayout subclass displays its items as rows of items similar to the App Store Feature tab without a nested UITableView/UICollectionView hack. You can use a single data source for all of your contents. Each section displays its items in a row.CollectionViewShelfLayout
supports collection view'sheader view and footer view similar to table view'stableHeaderView and tableFooterView alsosections' header and footer views too.
- iOS 9+
- Swift 4.0+
This requirement is due to usage of some Auto Layout APIs available in iOS 8 and 9 or later.If you want to useCollectionViewShelfLayout
in iOS 8, you can replace NSLayoutAnchor usage with other APIs.
This project comes with built inCollectionViewShelfLayout framework
target. You can dragCollectionViewShelfLayout.xcproj
file into your project, addCollectionViewShelfLayout framework
target as a target dependency and link/embed that framework. and Voila!!!
import CollectionViewShelfLayout
Add the following to yourPodfile
pod'CollectionViewShelfLayout'use_frameworks!
Add the following to yourCartfile
github"pitiphong-p/CollectionViewShelfLayout"
You can use CollectionViewShelfLayout in Swift 2.2 by checking out tag0.5.5
You can use CollectionViewShelfLayout in Swift 4.0 by checking out tag0.6.4
You can use CollectionViewShelfLayout in Swift 4.0 by checking out tag0.6.5
Set collecion view's layout to an instance ofCollectionViewShelfLayout
. Set the layout's properties you want (eg. cellSize). You can set its layout both via code orStoryboard
.
letshelfLayout=CollectionViewShelfLayout()shelfLayout.itemSize=CGSize(width:100, height:180)collectionView.collectionViewLayout= shelfLayout
CollectionViewShelfLayout
project comes with a demo app target. You can seeCollectionViewShelfLayout
in action by just runningAppStoreCollectionViewLayout-Demo
demo app target.
Pitiphong Phongpattranont
- [@pitiphong_p on Twitter] (https://twitter.com/pitiphong_p)
CollectionViewShelfLayout
is released under an MIT License.
Copyright © 2016-present Pitiphong Phongpattranont.
About
A UICollectionViewLayout subclass displays its items as rows of items similar to the App Store Feature tab without a nested UITableView/UICollectionView hack.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.