             return
         }
         
-        for var i = 1; i <= starCount; i++ {
+        var i = 1
+        while i <= starCount {
             let iv = UIImageView(image: offImage)
             addSubview(iv)
             stars.append(iv)
-
+            i += 1
         }
         
         layoutStars()

        if rating - Float(i) + 1 >= 0.5 {
            let star = stars[i-1]
            star.image = halfImage
            i++
        }
        
        
        for ; i <= starCount; i++ {
            let star = stars[i-1]
            star.image = offImage
        }
    }
}

                    
                    iv.center = CGPointMake(CGFloat(i) * distance + halfWidth * CGFloat(i - 1),
                        self.frame.size.height/2)
                    i += 1
                }
        }
    }
