目录
目录README.md

SwiftUI ContributionChartView

cover

Contribution Chart View is a SwiftUI package that provides a customizable chart view to display contributions over a period of time, similar to GitHub’s contribution chart.

SPM Compatible Cocoapods Compatible Carthage Compatible License: MIT

Features

  • Visualize contributions with customizable colors.
  • Adjustable number of days per row.
  • Support for total days.

Requirements

  • iOS 13.0+ / macOS 10.15+
  • Xcode 11.0+
  • Swift 5.0+

Installation

  • Clone the repository:
  • Open your Xcode project.
  • Drag the ContributionChartView folder from Finder into your Xcode project.
  • Ensure that the files are added to the appropriate target(s) in your project.

Usage

  • Import the module:
    import GithubSwiftCharts
  • Create an instance of ContributionChartView: ``` swift let contributionData = [ “2023-06-01”: 4, “2023-06-02”: 2, “2023-06-03”: 9, // Add your contribution data here ]

let daysPerRow = 23 let totalDays = 90

let chartView = ContributionChartView(contributionData: contributionData, daysPerRow: daysPerRow, totalDays: totalDays)

     
- Use chartView in your SwiftUI view hierarchy:
``` swift
     
     struct ContentView: View {
   var body: some View {
       VStack {
           // Your other views
           
           chartView
           
           // Your other views
       }
   }
}

Swift Package Manager

You can use the Swift Package Manager to install ContributionChartView by adding it as a dependency in your Package.swift file:

.package(url: "https://github.com/your-username/ContributionChartView.git", from: "1.0.0")

License

Feel free to use or to share this package as you want!

关于
14.6 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号