TRMosaicLayout alternatives and similar libraries
Based on the "Table View / Collection View" category.
Alternatively, view TRMosaicLayout alternatives based on common mentions on social networks and blogs.
-
SwipeCellKit
Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app, implemented in Swift. -
MCSwipeTableViewCell
DISCONTINUED. 👆 Convenient UITableViewCell subclass that implements a swippable content to trigger actions (similar to the Mailbox app). -
HGPlaceholders
Nice library to show placeholders and Empty States for any UITableView/UICollectionView in your project -
ReverseExtension
A UITableView extension that enables cell insertion from the bottom of a table view. -
Bohr
DISCONTINUED. Bohr allows you to set up a settings screen for your app with three principles in mind: ease, customization and extensibility. -
CenteredCollectionView
A lightweight UICollectionViewLayout that 'pages' and centers its cells 🎡 written in Swift -
CascadingTableDelegate
A no-nonsense way to write cleaner UITableViewDelegate and UITableViewDataSource in Swift. -
GLTableCollectionView
Netflix and App Store like UITableView with UICollectionView, written in pure Swift 4.2 -
ListPlaceholder
ListPlaceholder is a swift library allows you to easily add facebook style animated loading placeholder to your tableviews or collection views. -
KDDragAndDropCollectionView
This component allows for the transfer of data items between collection views through drag and drop -
DataSources
💾 🔜📱 Type-safe data-driven CollectionView, TableView Framework. (We can also use ASCollectionNode) -
DTTableViewManager
Protocol-oriented UITableView management, powered by generics and associated types. -
TLIndexPathTools
TLIndexPathTools is a small set of classes that can greatly simplify your table and collection views. -
CollapsibleTableSectionViewController
:tada: Swift library to support collapsible sections in a table view. -
RHPreviewCell
I envied so much Spotify iOS app this great playlist preview cell 😍, I decided to create my own one 🌶. Now you can give your users ability to quick check "what content is hidden under your UITableViewCell". Great think is that this Library not requires 3D Touch support from user device💥. -
SquareMosaicLayout
An extandable mosaic UICollectionViewLayout with a focus on extremely flexible customizations :large_orange_diamond: -
HoverConversion
DISCONTINUED. HoverConversion realized vertical paging with UITableView. UIViewController will be paging when reaching top or bottom of UITableView contentOffset. -
GenericDataSource
A generic small reusable components for data source implementation for UITableView/UICollectionView in Swift. -
PJFDataSource
PJFDataSource is a small library that provides a simple, clean architecture for your app to manage its data sources while providing a consistent user interface for common content states (i.e. loading, loaded, empty, and error). -
AZCollectionViewController
Easy way to integrate pagination with dummy views in CollectionView, make Instagram "Discover" within minutes. -
ios-dragable-table-cells
DISCONTINUED. Objective-C library for drag-n-drop of UITableViewCells in a navigation hierarchy of view controllers.
InfluxDB - Purpose built for real-time analytics at any scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of TRMosaicLayout or a related project?
README
TRMosaicLayout
A mosaic collection view layout inspired by Lightbox's Algorithm. This is a swift implementation/extension of @fmitech's FMMosaicLayout. The standard UICollectionViewFlowLayout
can be a boring presentation in your app, but TRMosaicLayout is a simple feature that will engage your users with your eyecatching content. If you don't believe me, checkout Snapchat's app and
their awesome layout in their Discover feed.
TRMosaicLayout implementation
Similar implementation used by @snapchat
Why use this
- TRMosaicLayout is great for displaying images that are in portrait or have a similar aspect ratio
- Examples
- Movie posters
- Book covers
- Magazines
- News articles
Installation
CocoaPods
You can use CocoaPods to install TRMosaicLayout
by adding it to your Podfile
:
platform :ios, '8.0'
use_frameworks!
pod 'TRMosaicLayout'
Then, import TRMosaicLayout
import TRMosaicLayout
Manually
- Download and drop
/TRMosaicLayout
folder in your project. - Congratulations!
Implementation
Create a subclass of UICollectionViewController
import TRMosaicLayout
class TRCollectionViewController: UICollectionViewController {
override func viewDidLoad() {
super.viewDidLoad()
let mosaicLayout = TRMosaicLayout()
self.collectionView?.collectionViewLayout = mosaicLayout
mosaicLayout.delegate = self
}
}
Extend your subclass of UICollectionViewController
with TRMosaicLayoutDelegate
extension TRCollectionViewController: TRMosaicLayoutDelegate {
func collectionView(collectionView:UICollectionView, mosaicCellSizeTypeAtIndexPath indexPath:NSIndexPath) -> TRMosaicCellType {
// I recommend setting every third cell as .Big to get the best layout
return indexPath.item % 3 == 0 ? TRMosaicCellType.Big : TRMosaicCellType.Small
}
func collectionView(collectionView:UICollectionView, layout collectionViewLayout: TRMosaicLayout, insetAtSection:Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 3, left: 3, bottom: 3, right: 3)
}
func heightForSmallMosaicCell() -> CGFloat {
return 150
}
}
Troubleshooting
The cell's aren't aligned properly
- Make sure the views you are adding to the cell have the correct frame
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath)
let imageView = UIImageView(image: image)
imageView.frame = cell.frame
cell.backgroundView = imageView
return cell
Getting a nil while unwrapping
error
- Make sure you set the delegate of
TRMosaicLayout
to yourcollectionViewController
mosaicLayout.delegate = self
Something else isn't working properly
- Use github's issue reporter on the right, this will you be your best bet as I'm on Github fairly regularly
- Send me an email [email protected]
Release History
- 1.0.0 Update to Swift 3
- 0.1.0 First release on CocoaPods
Contributions
I am happy to accept any open contributions. Just fork this project, make the changes and submit a pull request.
Author
Vincent Le, [email protected]
License
TRMosaicLayout is available under the MIT
license. See the LICENSE
file for more info.
*Note that all licence references and agreements mentioned in the TRMosaicLayout README section above
are relevant to that project's source code only.