Latest 1.0.0
Homepage https://github.com/lucashoeft/LSHContributionView
License MIT
Platforms ios 10.0
Frameworks UIKit, CoreGraphics

Language Platform License Version

Contribution view similar to Contribution Graph on GitHub

ContributionView

Features

  • Customizable color scheme
  • Automatic resizing and scaling

Installation

CocoaPods

To install LSHContributionView via CocoaPods, add the following line to your Podfile:

pod 'LSHContributionView'

Carthage

Soon

Usage

See the example Xcode project. It contains:

  • LSHContributionViewExample – a simple example containing two contribution views

Interface Builder

LSHContributionView can be set up in Interface Builder. To use it, set the custom view class to LSHContributionView. Some of the control’s parameters can be customized in Interface Builder.

Code

let dataSquare = [
            [0, 1, 2, 3, 4],
            [1, 2, 3, 4, 3],
            [2, 3, 4, 3, 2],
            [3, 4, 3, 2, 1],
            [4, 3, 2, 1, 0]
        ]

let contributionView = LSHContributionView(frame: CGRect(x: 100, y: 100, width: 200, height: 180))
contributionView.data = dataSquare
contributionView.colorScheme = "Halloween"
view.addSubview(contributionView)

Add and Update Entry:

contributionView.addEntry(with: CGPoint(x: 2, y: 2), level: 1)

Adjust Spacing and Margin:

contributionView.gridSpacing = 0
contributionView.gridMargin = 10

Available Color Schemes:

  • Default
  • Halloween
  • Blue

Requirements

  • iOS 10.0
  • Xcode 10, Swift 4.2

License

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

Latest podspec

{
    "name": "LSHContributionView",
    "version": "1.0.0",
    "summary": "Contribution view similar to Contribution Graph on GitHub",
    "description": "Customizable contribution view similar to Contribution Graph on GitHub",
    "homepage": "https://github.com/lucashoeft/LSHContributionView",
    "license": "MIT",
    "authors": "Lucas Hoeft",
    "social_media_url": "http://twitter.com/lucashoeft",
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/lucashoeft/LSHContributionView.git",
        "tag": "1.0.0"
    },
    "source_files": "LSHContributionView/**/*.swift",
    "frameworks": [
        "UIKit",
        "CoreGraphics"
    ]
}

Pin It on Pinterest

Share This