/Rate

swiftui component about rate

Primary LanguageSwift

Screenshot 2024-06-25 at 15 39 57 Screenshot 2024-06-25 at 15 40 06 Screenshot 2024-06-25 at 15 40 22

Rate

Rate is a simple and beautiful rating control written in SwiftUI, which supports touch gestures and can be customized with different colors and sizes.

Features

  • 支持自定义count。
  • 支持自定义icon。
  • 支持自定义color。
  • 支持自定义size。
  • 支持点击和滑动事件。
  • 支持震动反馈

Usage

To use Rate, simply import it into your SwiftUI project and create an instance of the RateView struct.

import Rate

struct ContentView: View {
    @State private var rating = 0

    var body: some View {
			// default propotize count: Int = 6, size: FontSize = .regular ,icon:IconType = .heart,color:Color = .pink 
			Rate(rating: $rating)
			
        }
    }
}

Customization

Rate supports customization of colors, sizes, labels, and more. To customize a RateView, simply pass in the desired values as parameters when creating the instance.

	Rate(rating: $rating, count: 5, size: .large, color: .pink)

Installation

Rate is available through Swift Package Manager. To install it, simply add Rate to your Package.swift file and run swift package update.

dependencies: [
                  .package(url: "https://github.com/golove/Rate.git", from: "1.0.0")
            ]
`