Skip to content

Commit

Permalink
- updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rursache committed Jul 19, 2022
1 parent 59c2ce0 commit c73a967
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@ Use SPM to install this library
## Usage
### Interface Builder
1. Add a UIView to your interface
2. In the Identiy Inspector, change Class to `RSStarRatingView`
2. In the Identiy Inspector, change Class to `RSRatingView`
3. In the Attributes Inspector you can now set:
* the **rating** (Float between 0 and 5)
* the **star color**
* the **Star Rounding** Raw Value - *IBInspectable can't handle enums, hence the raw value, see ENUM code below*
4. By checking **User Interaction Enabled** users can touch the view to enter a star rating. The rating stars updates while touching.

### Code
1. Create an instance of StarRatingView
`let starRatingView = RSStarRatingView(frame: CGRect(origin: .zero, size: CGSize(width: 250, height: 50)), rating: 3.5, color: .systemOrange, starRounding: .roundToHalfStar)`
1. Create an instance of `RSRatingView`
```
let starRatingView = RSRatingView(frame: CGRect(origin: .zero, size: CGSize(width: 250, height: 50)), rating: 3.5, color: .systemOrange, starRounding: .roundToHalfStar)
```

Natural aspect ratio is 5 width to 1 height.
2. Add the view as a subview
3. Properties (set and get)
Expand Down

0 comments on commit c73a967

Please sign in to comment.