https://github.com/lucashoeft/lshcontributionview
Custom UIView to visualize repeating activities of a user in iOS apps
https://github.com/lucashoeft/lshcontributionview
calendar-view contribution-graph contributions-calendar gitstats ios swift
Last synced: 7 months ago
JSON representation
Custom UIView to visualize repeating activities of a user in iOS apps
- Host: GitHub
- URL: https://github.com/lucashoeft/lshcontributionview
- Owner: lucashoeft
- License: mit
- Created: 2019-01-06T09:01:54.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-06T10:07:52.000Z (about 7 years ago)
- Last Synced: 2025-06-13T08:19:21.153Z (8 months ago)
- Topics: calendar-view, contribution-graph, contributions-calendar, gitstats, ios, swift
- Language: Swift
- Homepage:
- Size: 102 KB
- Stars: 12
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LSHContributionView
[](https://developer.apple.com/swift) [](http://cocoapods.org/pods/LSHContributionView) [](http://cocoapods.org/pods/LSHContributionView) [](http://cocoapods.org/pods/LSHContributionView)
Contribution view similar to Contribution Graph on GitHub

## Features
- Customizable color scheme
- Automatic resizing and scaling
## Installation
### CocoaPods
To install `LSHContributionView` via [CocoaPods](http://cocoapods.org), 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
```swift
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:
```swift
contributionView.addEntry(with: CGPoint(x: 2, y: 2), level: 1)
```
Adjust Spacing and Margin:
```swift
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.