SquareMosaicLayout alternatives and similar libraries
Based on the "Table View / Collection View" category.
Alternatively, view SquareMosaicLayout 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💥. -
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.
CodeRabbit: AI Code Reviews for Developers
* 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 SquareMosaicLayout or a related project?
README
SquareMosaicLayout
An extandable mosaic UICollectionViewLayout with a focus on extremely flexible customizations.
Note
This layout is not of waterfall type. It was designed for layouts where we can predict the size of rectangular box which contains the number of full cells. Check out how to copy TRMosaicLayout or FMMosaicLayout using SquareMosaicLayout
Visual
Example | Layout | Pattern | Blocks |
---|---|---|---|
Build and run an example project to see how it really works | Let's imagine that we want a UICollectionView with some mosaic layout that looks like this | The red part of frames repeats while scrolling. So we should do only the red pattern and then repeat it | The pattern is split it into smaller blocks that can be reused for some other layout or pattern |
Installation
SquareMosaicLayout is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SquareMosaicLayout', '4.1.2'
Capabilities
- [x] Layout can be vertical or horizontal.
- [x] Each section can have its own pattern of frames.
- [x] Each section can have its own header frame (optional).
- [x] Each section can have its own footer frame (optional).
- [x] Each section can have its own background (optional).
- [x] Space between sections can be changed (optional).
- [x] Space between, before and after blocks in pattern can be changed (optional).
- [x] Each section can have one repeated block.
Author
iwheelbuy, [email protected]
License
SquareMosaicLayout is available under the MIT license. See the LICENSE file for more info.
Example - copying TRMosaicLayout
final class TRMosaicLayoutCopy: SquareMosaicLayout, SquareMosaicDataSource {
convenience init() {
self.init(direction: SquareMosaicDirection.vertical)
self.dataSource = self
}
func layoutPattern(for section: Int) -> SquareMosaicPattern {
return TRMosaicLayoutCopyPattern()
}
}
class TRMosaicLayoutCopyPattern: SquareMosaicPattern {
func patternBlocks() -> [SquareMosaicBlock] {
return [
TRMosaicLayoutCopyBlock1(),
TRMosaicLayoutCopyBlock2()
]
}
}
public class TRMosaicLayoutCopyBlock1: SquareMosaicBlock {
public func blockFrames() -> Int {
return 3
}
public func blockFrames(origin: CGFloat, side: CGFloat) -> [CGRect] {
let minWidth = side / 3.0
let maxWidth = side - minWidth
let minHeight = minWidth * 1.5
let maxHeight = minHeight + minHeight
var frames = [CGRect]()
frames.append(CGRect(x: 0, y: origin, width: maxWidth, height: maxHeight))
frames.append(CGRect(x: maxWidth, y: origin, width: minWidth, height: minHeight))
frames.append(CGRect(x: maxWidth, y: origin + minHeight, width: minWidth, height: minHeight))
return frames
}
}
public class TRMosaicLayoutCopyBlock2: SquareMosaicBlock {
public func blockFrames() -> Int {
return 3
}
public func blockFrames(origin: CGFloat, side: CGFloat) -> [CGRect] {
let minWidth = side / 3.0
let maxWidth = side - minWidth
let minHeight = minWidth * 1.5
let maxHeight = minHeight + minHeight
var frames = [CGRect]()
frames.append(CGRect(x: 0, y: origin, width: minWidth, height: minHeight))
frames.append(CGRect(x: 0, y: origin + minHeight, width: minWidth, height: minHeight))
frames.append(CGRect(x: minWidth, y: origin, width: maxWidth, height: maxHeight))
return frames
}
}
Example - copying FMMosaicLayout
final class FMMosaicLayoutCopy: SquareMosaicLayout, SquareMosaicDataSource {
convenience init() {
self.init(direction: SquareMosaicDirection.vertical)
self.dataSource = self
}
func layoutPattern(for section: Int) -> SquareMosaicPattern {
return FMMosaicLayoutCopyPattern()
}
}
class FMMosaicLayoutCopyPattern: SquareMosaicPattern {
func patternBlocks() -> [SquareMosaicBlock] {
return [
FMMosaicLayoutCopyBlock1(),
FMMosaicLayoutCopyBlock2(),
FMMosaicLayoutCopyBlock3(),
FMMosaicLayoutCopyBlock2(),
FMMosaicLayoutCopyBlock2()
]
}
}
public class FMMosaicLayoutCopyBlock1: SquareMosaicBlock {
public func blockFrames() -> Int {
return 5
}
public func blockFrames(origin: CGFloat, side: CGFloat) -> [CGRect] {
let min = side / 4.0
let max = side - min - min
var frames = [CGRect]()
frames.append(CGRect(x: 0, y: origin, width: max, height: max))
frames.append(CGRect(x: max, y: origin, width: min, height: min))
frames.append(CGRect(x: max, y: origin + min, width: min, height: min))
frames.append(CGRect(x: max + min, y: origin, width: min, height: min))
frames.append(CGRect(x: max + min, y: origin + min, width: min, height: min))
return frames
}
}
public class FMMosaicLayoutCopyBlock2: SquareMosaicBlock {
public func blockFrames() -> Int {
return 4
}
public func blockFrames(origin: CGFloat, side: CGFloat) -> [CGRect] {
let min = side / 4.0
var frames = [CGRect]()
frames.append(CGRect(x: 0, y: origin, width: min, height: min))
frames.append(CGRect(x: min, y: origin, width: min, height: min))
frames.append(CGRect(x: min * 2, y: origin, width: min, height: min))
frames.append(CGRect(x: min * 3, y: origin, width: min, height: min))
return frames
}
}
public class FMMosaicLayoutCopyBlock3: SquareMosaicBlock {
public func blockFrames() -> Int {
return 5
}
public func blockFrames(origin: CGFloat, side: CGFloat) -> [CGRect] {
let min = side / 4.0
let max = side - min - min
var frames = [CGRect]()
frames.append(CGRect(x: 0, y: origin, width: min, height: min))
frames.append(CGRect(x: 0, y: origin + min, width: min, height: min))
frames.append(CGRect(x: min, y: origin, width: min, height: min))
frames.append(CGRect(x: min, y: origin + min, width: min, height: min))
frames.append(CGRect(x: max, y: origin, width: max, height: max))
return frames
}
}
*Note that all licence references and agreements mentioned in the SquareMosaicLayout README section above
are relevant to that project's source code only.