ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - kishikawakatsumi/SpreadsheetView: Full configurable spreadsheet view user interfaces for iOS applications. With this framework, you can easily create complex layouts like schedule, gantt chart or 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 or timetable as if you are using Excel...
Visit Site

GitHub - kishikawakatsumi/SpreadsheetView: Full configurable spreadsheet view user interfaces for iOS applications. With this framework, you can easily create complex layouts like schedule, gantt chart or timetable as if you are using Excel.

GitHub - kishikawakatsumi/SpreadsheetView: Full configurable spreadsheet view user interfaces for iOS applications. With this framework, you can easily create complex layouts like schedule, gantt chart or timetable as if you are using Excel.

kishikawakatsumi/SpreadsheetView has moved!

It is being actively maintained at bannzai/SpreadsheetView.

This fork was created when the project was moved, and is provided for backwards compatibility for old projects, but no guarantees are made on how up to date it will be.

You're encouraged to update your import statements to use the official bannzai/SpreadsheetViewk version above.

Apologies for the fuss, the new place has amazing people maintaining the community alive.


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

  • Fixed column and row headers
  • Merge cells
  • Circular infinite scrolling automatically
  • Customize gridlines and borders for each cell
  • Customize inter cell spacing vertically and horizontally
  • Fast scrolling, memory efficient
  • UICollectionView like API
  • 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:

pod 'SpreadsheetView'

Carthage

For Carthage, add the following to your Cartfile:

github "kishikawakatsumi/SpreadsheetView"

Getting Started

The minimum requirement is connecting a data source to return the number of columns/rows, and each column width/row height.

import UIKit
import SpreadsheetView

class ViewController: UIViewController, SpreadsheetViewDataSource {
    @IBOutlet weak var spreadsheetView: SpreadsheetView!

    override func viewDidLoad() {
        super.viewDidLoad()
        spreadsheetView.dataSource = self
    }

    func numberOfColumns(in spreadsheetView: SpreadsheetView) -> Int {
        return 200
    }

    func numberOfRows(in spreadsheetView: SpreadsheetView) -> Int {
        return 400
    }

    func spreadsheetView(_ spreadsheetView: SpreadsheetView, widthForColumn column: Int) -> CGFloat {
      return 80
    }

    func spreadsheetView(_ spreadsheetView: SpreadsheetView, heightForRow row: Int) -> CGFloat {
      return 40
    }
}

Usage

Freeze column and row headers

Freezing a column or row behaves as a fixed column/row header.

Column Header

func frozenColumns(in spreadsheetView: SpreadsheetView) -> Int {
    return 2
}

Row Header

func frozenRows(in spreadsheetView: SpreadsheetView) -> Int {
    return 2
}

both

func frozenColumns(in spreadsheetView: SpreadsheetView) -> Int {
    return 2
}

func frozenRows(in spreadsheetView: SpreadsheetView) -> Int {
    return 2
}

Merge cells

Multiple cells can be merged and then they are treated as one cell. It is used for grouping cells.

func mergedCells(in spreadsheetView: SpreadsheetView) -> [CellRange] {
    return [CellRange(from: (row: 1, column: 1), to: (row: 3, column: 2)),
            CellRange(from: (row: 3, column: 3), to: (row: 8, column: 3)),
            CellRange(from: (row: 4, column: 0), to: (row: 7, column: 2)),
            CellRange(from: (row: 2, column: 4), to: (row: 5, column: 8)),
            CellRange(from: (row: 9, column: 0), to: (row: 10, column: 5)),
            CellRange(from: (row: 11, column: 2), to: (row: 12, column: 4))]
}

Circular Scrolling

Your table acquires infinite scroll just set circularScrolling property.

Enable horizontal circular scrolling

spreadsheetView.circularScrolling = CircularScrolling.Configuration.horizontally

Enable vertical circular scrolling

spreadsheetView.circularScrolling = CircularScrolling.Configuration.vertically

Both

spreadsheetView.circularScrolling = CircularScrolling.Configuration.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.

spreadsheetView.circularScrolling = 
    CircularScrolling.Configuration.horizontally.columnHeaderNotRepeated
spreadsheetView.circularScrolling = 
    CircularScrolling.Configuration.both.columnHeaderStartsFirstRow

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

spreadsheetView.intercellSpacing = CGSize(width: 1, height: 1)

Gridlines

SpreadsheetView's gridStyle property is applied to the entire table.

spreadsheetView.gridStyle = .solid(width: 1, color: .lightGray)

You can set different gridStyle for each cell and each side of the cell. If you set cell's gridStyle property to default, SpreadsheetView's gridStyle property will be applied. Specify none means the grid will not be drawn.

cell.gridlines.top = .solid(width: 1, color: .blue)
cell.gridlines.left = .solid(width: 1, color: .blue)
cell.gridlines.bottom = .none
cell.gridlines.right = .none

Border

You can set different borderStyle for each cell as well.

cell.borders.top = .solid(width: 1, color: .red)
cell.borders.left = .solid(width: 1, color: .red)
cell.borders.bottom = .solid(width: 1, color: .red)
cell.borders.right = .solid(width: 1, color: .red)

Author

Kishikawa Katsumi, [email protected]

License

SpreadsheetView is available under the MIT license. See the LICENSE file for more info.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory