Giter Site home page Giter Site logo

elangridview's Introduction

alt Elangr

ElanGridView

Version License Platform

ScreenShot

Kiku Kiku

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

or use pod try ElanGridView

Sample Code

import UIKit
import ElanGridView

class ViewController: UIViewController, ElanGridViewDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()
        let elanGridview: ElanGridView = ElanGridView(frame: self.view.frame)
        elanGridview.cellHeight = 250.0 // cards will match the parent height if cellHeight is not set or set to 0.0
        elanGridView.cellWidth = 250.0 // cards will match the parent width if cellWidth is not set or set to 0.0
        elanGridview.paddingTop = 20.0 // default value 10.0
        elanGridview.paddingLeft = 20.0 // default value 10.0
        elanGridview.paddingRight = 20.0 // default value 10.0
        elanGridview.paddingBottom = 20.0 // default value 10.0
        elanGridview.maxColumns = 10 // default value 1
        elanGridview.allowsMultipleSelection = true // default value false
        elanGridview.selectedColor = .red // default value UIColor(rgb: 0x0095ff)

        self.view.addSubview(elanGridview)

        elanGridview.elanGridViewDelegate = self
        for i in (0..<40){
            elanGridview.addCell(){
                cellView in
                let testView: UILabel = UILabel(CGRect(x: 10, y: 10, width: 200, height: 100))
                cellView.indexPath.tag = "hello \(i)"
                testView.text = "\(cellView.indexPath.row) \(cellView.indexPath.column)"

                cellView.addSubview(testView)
            }
        }


    }

    func onTapCard(_ elanCard: ElanCard) {

    }

    func onLongPressCard(_ elanCard: ElanCard) {

    }

    func selectedCards(_ selectedCards: [ElanIndex]) {

    }



}

Installation

ElanGridView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ElanGridView'

License

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

elangridview's People

Contributors

imranelh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.