     }
 }
 
+// MARK: - Description
 extension KZSegmentedPageView {
     /**
      Scrolls to the view controller at the given index. Automatically calculates

    
    @IBInspectable open var scHeight: CGFloat = 29 {
        didSet {
            segmentedHeighConstraint.constant = scHeight
            view.layoutIfNeeded()
        }
    }
    
    @IBInspectable open var scPaddingLeft: CGFloat = 8 {
        didSet {
            segmentedLeftPaddingConstraint.constant = scPaddingLeft
            view.layoutIfNeeded()
        }
    }
    
    @IBInspectable open var scPaddingRight: CGFloat = 8 {
        didSet {
            segmentedRightPaddingConstraint.constant = scPaddingRight
            view.layoutIfNeeded()
        }
    }
    
    @IBInspectable open var scPaddingTop: CGFloat = 8 {
        didSet {
            segmentedTopPaddingConstraint.constant = scPaddingTop
            view.layoutIfNeeded()
        }
    }
    
    @IBInspectable open var scPaddingBottom: CGFloat = 8 {
        didSet {
            segmentedBottomPaddingToPageViewControllerConstraint.constant = scPaddingBottom
            view.layoutIfNeeded()
        }
    }
    
    @IBInspectable open var scTintColor: UIColor = UIColor(colorLiteralRed: 0, green: 122/255, blue: 1, alpha: 1) {
        didSet {
            segmentedControl.tintColor = scTintColor
        }
    }
    
    @IBInspectable open var scBackgroundColor: UIColor = UIColor.clear {
        didSet {
            segmentedControl.backgroundColor = scBackgroundColor
            segmentedControl.clipsToBounds = true
            segmentedControl.layer.cornerRadius = 4
        }
    }
    
    @IBInspectable open var viewBackgroundColor: UIColor = UIColor.white {
        didSet {
            view.backgroundColor = viewBackgroundColor
        }
    }
    

    
    open var segments: [KZSegmentedPageView.Segment] = [] {
        didSet {
            self.pageViewController.dataSource = self
            self.pageViewController.delegate = self
            
            if let initialViewController = segments.first?.viewController {
                self.scrollToViewController(initialViewController, direction: .forward)
            }
            self.delegate?.segmentedPageView(self, didUpdatePageCount: segments.count)
            
            self.segmentedControl.removeAllSegments()
            
            self.segments.enumerated().forEach { (index, element) in
                self.segmentedControl.insertSegment(withTitle: element.title, at: index, animated: false)
            }
            
            self.segmentedControl.selectedSegmentIndex = 0
            self.delegate?.segmentedPageView(self, didSelectSegmentAtIndex: 0)
        }
    }
    
