Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mokagio/UICollectionViewLeftAlignedLayout
A layout for UICollectionView that aligns the cells to the left.
https://github.com/mokagio/UICollectionViewLeftAlignedLayout
Last synced: 3 months ago
JSON representation
A layout for UICollectionView that aligns the cells to the left.
- Host: GitHub
- URL: https://github.com/mokagio/UICollectionViewLeftAlignedLayout
- Owner: mokagio
- License: mit
- Created: 2014-04-21T16:09:36.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-20T11:53:43.000Z (almost 2 years ago)
- Last Synced: 2024-08-01T08:04:29.328Z (3 months ago)
- Language: Objective-C
- Homepage:
- Size: 771 KB
- Stars: 1,292
- Watchers: 22
- Forks: 179
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - UICollectionViewLeftAlignedLayout - A layout for UICollectionView that aligns the cells to the left. (etc)
README
UICollectionView Left Aligned Layout
====================================A `UICollectionViewLayout` implementation that aligns the cells to the left.
_Check out the twin project [`UICollectionViewRightAlignedLayout`](https://github.com/mokagio/UICollectionViewRightAlignedLayout)_
## Installation with CocoaPods
```ruby
platform :ios, '6.0'pod 'UICollectionViewLeftAlignedLayout'
```## Usage
Simply set `UICollectionViewLeftAlignedLayout` as the layout object for your collection view either via code:
```objc
CGRect frame = ...
UICollectionViewLeftAlignedLayout *layout = [[UICollectionViewLeftAlignedLayout alloc] init];
UICollectionView *leftAlignedCollectionView = [[UICollectionView alloc] initWithFrame:frame collectionViewLayout:layout];
```or from Interface Builder:
_img needed here_
`UICollectionViewLeftAlignedLayout` is a subclass of `UICollectionViewFlowLayout`, so your collection view delegate can use all the delegate methods of [`UICollectionViewDelegateFlowLayout`](https://developer.apple.com/library/ios/documentation/uikit/reference/UICollectionViewDelegateFlowLayout_protocol/Reference/Reference.html).
For those of you who like consistency there is an `UICollectionViewDelegateLeftAlignedLayout` protocol that your delegate object can conform to. Is nothing more than an empty extension of `UICollectionViewDelegateFlowLayout`.
## License
`UICollectionViewLeftAlignedLayout` is released under the [MIT license](https://github.com/mokagio/UICollectionViewLeftAlignedLayout/blob/master/LICENSE).
---
Hacked together with passion by [@mokagio](https://twitter.com/mokagio)