Create a simple and easy-to-use Grid Layout
With this tool you can create an awesome grid layout based in collection view. It's simple, easy to implement and highly customizable.
POD Installation:
pod 'GridLayout', :git => 'https://github.com/leodegeus7/awesomeGrid.git'
To use this tool you need to follow few steps:
- Create a Collection View inside a Controller on StoryBoard and set "GridView" in class of object and "GridLayout" in Custom Layout Class;
- Create an outlet with this object in your Controller, import the framework GridLayout and set the delegate GridLayoutDelegate;
- Override the func viewDidLayoutSubviews of your View Controller and insert the follow code inside:
gridView.gridDelegate = self
gridView.initialize(numberOfColumns: Int, debug: Bool ,optionalPadding: Int)
- Get de function getCellsSupport of delegate in your Controller, and create a array of CellSupports. CellSupport is the way that you set the content of cell and the position of cell in grid. You can construct a CellSupport passing your grid Layout and the coordinates of item:
CellSupport(gridView: GridView, row: Int, column: Int, squaresOfHeight: Int, squaresOfWidth: Int)
- Customize the view of your new Cell Support adding subViews in cellSupport.view
- Override func viewWillTransition of your Controller and set
gridView.viewWillTransition(size: size)
- 0.0.1
- First Commit
Leonardo Alexandre de Geus – @leodegeus7 – leonardodegeus@gmail.com
See LICENSE
for more information.