LSHContributionView
Custom UIView to visualize repeating activities of a user in iOS apps
Install / Use
/learn @lucashoeft/LSHContributionViewREADME
LSHContributionView
Contribution view similar to Contribution Graph on GitHub
<img src="LSHContributionView.png" alt="ContributionView" width=375>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.
Related Skills
node-connect
349.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
