         }
     }
     
-    func addNecessarySteps() {
-        if Int(self.numberOfSteps) > self.subviews.count {
-            for index in self.subviews.count..<Int(self.numberOfSteps) {
-                let view = UIView(frame: self.stepFrameForIndex(index))
-                view.backgroundColor = self.stepsColor
-                view.alpha = 0.0
-                
-                self.addSubview(view)
-                
-                UIView.animateWithDuration(0.2, animations: { 
-                    view.alpha = 1.0
-                })
-            }
-        }
-    }
+    // MARK: Helper methods
     
+    /**
+        Calculates the frame of a step view in a given position
+     
+        - Parameter index: The position of the step view
+     
+        - Returns: The rect of the step view
+     */
     func stepFrameForIndex(index: Int) -> CGRect {
         let separationsWidth = self.stepsSeparation * CGFloat(self.numberOfSteps - 1)
         let stepsWidth = (self.frame.size.width - separationsWidth) / CGFloat(self.numberOfSteps);


import UIKit

public class StepByStep: UIView {

    public var currentStepIndex: UInt {
        didSet {
            if self.currentStepIndex > self.numberOfSteps {

            updateCurrentStep()
        }
    }
    /// The total number of steps in the progress bar
    public var numberOfSteps: UInt {
        didSet {
            self.updateStepByStepView()
        }
    }
    /// The separation between steps of the progress bar
    public var stepsSeparation: CGFloat
    /// The colour of the non completed steps in the progress bar
    public var stepsColor: UIColor
    
    /**
        Initialises a new StepByStep view with a given frame and with other default values:
        5 orange steps, non of them completed and a separation of 5.0 points between them
     
        - Parameter frame: The frame with the size and position of the view
     
        - Returns: An initialised StepByStep view component
     */
    override public init(frame: CGRect) {
        self.currentStepIndex = 0
        self.numberOfSteps = 5
