SpreadsheetView
Full configurable spreadsheet view user interfaces for iOS applications. With this framework, you can easily create complex layouts like schedule, Gantt chart, timetable as if you are using Excel.
Full configurable spreadsheet view user interfaces for iOS applications. With this framework, you can easily create complex layouts like schedule, Gantt chart, timetable as if you are using Excel.
Features
- [x] Fixed column and row headers
- [x] Merge cells
- [x] Circular infinite scrolling automatically
- [x] Customize gridlines and borders for each cell
- [x] Customize inter cell spacing vertically and horizontally
- [x] Fast scrolling, memory efficient
- [x]
UICollectionView
like API - [x] Well unit tested
Find the above displayed examples in the Examples
folder.
Requirements
SpreadsheetView is written in Swift 3. Compatible with iOS 8.0+
Installation
CocoaPods
SpreadsheetView is available through CocoaPods. To install
it, simply add the following line to your Podfile:
Carthage
For Carthage, add the following to your Cartfile
:
Getting Started
The minimum requirement is connecting a data source to return the number of columns/rows, and each column width/row height.
Usage
Freeze column and row headers
Freezing a column or row behaves as a fixed column/row header.
Column Header
Row Header
both
Merge cells
Multiple cells can be merged and then they are treated as one cell. It is used for grouping cells.
Circular Scrolling
Your table acquires infinite scroll just set circularScrolling
property.
Enable horizontal circular scrolling
Enable vertical circular scrolling
Both
If circular scrolling is enabled, you can set additional parameters that the option not to repeat column/row header and to extend column/row header to the left/top edges. CircularScrolling.Configuration
is a builder pattern, can easily select the appropriate combination by chaining properties.
e.g.
Customize gridlines, borders and cell spacing
You can customize the appearance of grid lines and borders of the cell. You can specify whether a cell has a grid line or border. Grid lines and borders can be displayed on the left, right, top, or bottom, or around all four sides of the cell.
The difference between gridlines and borders is that the gridlines are drawn at the center of the inter-cell spacing, but the borders are drawn to fit around the cell.
Cell spacing
Gridlines
SpreadsheetView
's gridStyle
property is applied to the entire table.
You can set different gridStyle
for each cell and each side of the cell. If you set cell's gridStyle
property todefault
, SpreadsheetView
'sgridStyle
property will be applied. Specify none
means the grid will not be drawn.
Border
You can set different borderStyle
for each cell as well.