Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A UICollectionViewLayout subclass displays its items as rows of items similar to the App Store Feature tab without a nested UITableView/UICollectionView hack.

License

NotificationsYou must be signed in to change notification settings

pitiphong-p/CollectionViewShelfLayout

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.

CollectionViewShelfLayout screenshot

Requirements

  • 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.

Installation

Manaully

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

CocoaPods

Add the following to yourPodfile

pod'CollectionViewShelfLayout'use_frameworks!

Carthage

Add the following to yourCartfile

github"pitiphong-p/CollectionViewShelfLayout"

Swift 2

You can use CollectionViewShelfLayout in Swift 2.2 by checking out tag0.5.5

Swift 4.0

You can use CollectionViewShelfLayout in Swift 4.0 by checking out tag0.6.4

Swift 4.2

You can use CollectionViewShelfLayout in Swift 4.0 by checking out tag0.6.5

Usage

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

Demo App

CollectionViewShelfLayout project comes with a demo app target. You can seeCollectionViewShelfLayout in action by just runningAppStoreCollectionViewLayout-Demo demo app target.

Contact

Pitiphong Phongpattranont

License

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

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp