GridView alternatives and similar libraries
Based on the "UITableView" category.
Alternatively, view GridView alternatives based on common mentions on social networks and blogs.
-
folding-cell
:octocat: 📃 FoldingCell is an expanding content cell with animation made by @Ramotion -
SwipeCellKit
Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app, implemented in Swift. -
Persei
Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift -
DGElasticPullToRefresh
Elastic pull to refresh for iOS developed in Swift -
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. -
ExpandableCell
✨ Awesome expandable, collapsible tableview cell for iOS written in Swift 5 -
DiffableDataSources
💾 A library for backporting UITableView/UICollectionViewDiffableDataSource. -
PullToRefreshSwift
iOS Simple Cool PullToRefresh Library. It is written in pure swift. -
KJCategories
Collection of native ios extensions and classes to boost development process. Such as UIKit, Foundation, QuartzCore, Accelerate, OpenCV, CoreGraphics, os and more. 超实用开发加速工具库 -
QuickTableViewController
A simple way to create a UITableView for settings in Swift. -
YNExpandableCell
✨ Awesome expandable, collapsible tableview cell for iOS written in Swift 4 -
CollapsibleTableSectionViewController
:tada: Swift library to support collapsible sections in a table view. -
ExpyTableView
Make your table view expandable just by implementing one method. -
WLEmptyState
WLEmptyState is an iOS based component that lets you customize the view when the dataset of a UITableView or a UICollectionView is empty. We created a sample project with the WLEmptyState component to show how you can use it. -
SwiftyComments
UITableView based component designed to display a hierarchy of expandable/foldable comments. -
AEAccordion
Simple and lightweight UITableViewController with accordion effect (expand / collapse cells) -
SectionScrubber
A component to quickly scroll between collection view sections -
SelectionList
Simple single-selection or multiple-selection checklist, based on UITableView -
SPDiffable
Wrapper of Apple Diffable Data Source. Including side bar and ready-use models. -
OKTableViewLiaison
Framework to help you better manage UITableViews -
AZTableViewController
Elegant and easy way to integrate pagination with dummy views -
FDTextFieldTableViewCell
A UITableViewCell with an editable text field -
CollapsibleTable
Collapsable table view sections with custom section header views. -
Doppelganger-Swift
Array diffs as collection view wants it - now in Swift ✨ -
CKTextFieldTableCell
UITableViewCell drop-in replacement with support of UITextField
WorkOS - The modern identity platform for B2B SaaS
* 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 GridView or a related project?
README
GridView
GridView can tile the view while reusing it. It has an API like UIKit that works fast. Even when device rotates it smoothly relayout.
Appetize's Demo
You Can
- Scroll like paging
- Scroll infinitely
- Scale the view
- Call API like the
UITableView
Requirements
- Swift 5.0
- iOS 9.0 or later
How to Install
CocoaPods
Add the following to your Podfile
:
pod "G3GridView"
:warning: WARNING : If you want to install from
CocoaPods
, must addG3GridView
to Podfile because there is aGridView
different from thisGridView
.
Carthage
Add the following to your Cartfile
:
github "KyoheiG3/GridView"
Over View
GridView can scroll in any direction while reusing Cell like UITableView
. Also it is based UIScrollView
and paging and scaling are possible. If necessary, it is possible to repeat the left and right scroll infinitely.
GridView is one UIScrollView
, but the range which Cell is viewed depends on Superview. Cell reuse is also done within the range which Superview is viewed, so its size is very important.
On the other hand, scaling and paging depend to position and size of GridView. 'bounds' is important for paging, 'frame' is important in scaling. The same is true for offset of content.
The following image is a visual explanation of the view hierarchy.
You can use it like the UITableView
APIs. However, there is concept of Column
. The following functions are delegate APIs of 'GridView'.
func gridView(_ gridView: GridView, numberOfRowsInColumn column: Int) -> Int
func gridView(_ gridView: GridView, cellForRowAt indexPath: IndexPath) -> GridViewCell
@objc optional func numberOfColumns(in gridView: GridView) -> Int
You can see that must return the count.
Examples
This project is including two examples that is timetable and paging. Those can change on Interface Builder for following:
Try the two examples.
timetable | paging |
---|---|
Usage
Variables
Infinite Loop
A horizontal loop is possible.
open var isInfinitable: Bool
- Default is
true
. - Set
false
if you don't need to loop of view.
gridView.isInfinitable = true
Scaling
Content is done relayout rather than scaling like 'UIScrollView'.
open var minimumScale: Scale
open var maximumScale: Scale
- Default for x and y are 1.
- Set the vertical and horizontal scales.
public var currentScale: Scale { get }
- Get current vertical and horizontal scales.
gridView.minimumScale = Scale(x: 0.5, y: 0.5)
gridView.maximumScale = Scale(x: 1.5, y: 1.5)
Fill for Cell
It is possible to decide the placement of Cell at relayout.
open var layoutWithoutFillForCell: Bool
- Default is
false
. - Set
true
if need to improved view layout performance.
false | true |
---|---|
gridView.layoutWithoutFillForCell = true
Content Offset
If isInfinitable
is true, contentOffset
depends on the content size including size to loop. It is possible to take content offset that actually visible.
open var actualContentOffset: CGPoint { get }
Delegate
Set the delegate destination. This delegate property is UIScrollViewDelegate
but, actually set the GridViewDelegate
.
weak open var dataSource: GridViewDataSource?
open var delegate: UIScrollViewDelegate?
Functions
State
Get the view state.
public func visibleCells<T>() -> [T]
public func cellForRow(at indexPath: IndexPath) -> GridViewCell?
public func rectForRow(at indexPath: IndexPath) -> CGRect
public func indexPathsForSelectedRows() -> [IndexPath]
public func indexPathForRow(at position: CGPoint) -> IndexPath
Operation
Operate the view.
public func contentScale(_ scale: CGFloat)
public func reloadData()
public func invalidateContentSize()
public func invalidateLayout(horizontally: Bool = default)
public func deselectRow(at indexPath: IndexPath)
override open func setContentOffset(_ contentOffset: CGPoint, animated: Bool)
public func scrollToRow(at indexPath: IndexPath, at scrollPosition: GridViewScrollPosition = default, animated: Bool = default)
LICENSE
Under the MIT license. See LICENSE file for details.
*Note that all licence references and agreements mentioned in the GridView README section above
are relevant to that project's source code only.