title: Change of value label according to change of star rating view in Swift
body: <p>I am making a screen giving a movie star rating. I am creating a view with 1 to 10 points below 5 stars. I would like to make an integer rise by one for every half of a star.</p>
  
  <p>I'm using Cosmos view. The problem is that the integer is incremented by one when the star is full, not by 1 every time the star is filled in half.</p>
  
  <pre><code>import UIKit
  
  class CommentsViewController: UIViewController {
  
  
      @IBOutlet weak var rateView: CosmosView!
      @IBOutlet weak var rateLabel: UILabel!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          rateView.settings.fillMode = .half
  
          rateView.didTouchCosmos = didTouchCosmos
      }
  
      private class func formatValue(_ value: Double) -&gt; Int {
          return Int(value)
      }
  
      private func didTouchCosmos(_ rating: Double) {
          rateLabel.text = "\(CommentsViewController.formatValue(rating))"
  
      }
  }
  </code></pre>
  
  <p>When using the cosmos view, can I change the code so that the integer is incremented by 1 each time the star is filled in half?</p>