     }
     
     private func configureButton(tuple : CHButton, title : String, position : Int) {
-        tuple.button.setTitle(title, forState: UIControlState.Normal)
+        tuple.button.setTitle(title, for: UIControlState.normal)
         tuple.button.layer.cornerRadius = self.frame.height/2
         if self.defaultSelectedDay == position {
-            tuple.button.setTitleColor(selectedTitleColor, forState: .Normal)
+            tuple.button.setTitleColor(selectedTitleColor, for: .normal)
         } else {
-            tuple.button.setTitleColor(titleColor, forState: .Normal)
+            tuple.button.setTitleColor(titleColor, for: .normal)
         }
-        tuple.button.addTarget(self, action: #selector(CHDayPicker.selectDay(_:)), forControlEvents: UIControlEvents.TouchUpInside)
+        tuple.button.addTarget(self, action: #selector(CHDayPicker.selectDay(sender:)), for: UIControlEvents.touchUpInside)
         tuple.button.tag = position
         self.addSubview(tuple.button)
     }
     
     private func configureLayer(tuple : CHButton) {
         let minSize = min(tuple.button.frame.size.width, tuple.button.frame.size.height)
-        tuple.selectedLayer.frame = CGRectMake(tuple.button.frame.size.width/2 - minSize/2, tuple.button.frame.size.height/2 - minSize/2 , minSize, minSize)
-        tuple.selectedLayer.backgroundColor = UIColor.clearColor().CGColor
+        tuple.selectedLayer.frame = CGRect(x: tuple.button.frame.size.width/2 - minSize/2, y: tuple.button.frame.size.height/2 - minSize/2 , width: minSize, height: minSize)
+        tuple.selectedLayer.backgroundColor = UIColor.clear.cgColor
         tuple.selectedLayer.cornerRadius = minSize/2
         tuple.button.layer.addSublayer(tuple.selectedLayer)
     }

    
    @IBInspectable public var defaultSelectedDay : Int = -1
    @IBInspectable public var singleSelection : Bool = false
    @IBInspectable public var titleColor : UIColor = UIColor.blackColor()
    @IBInspectable public var selectedBackgroundColor : UIColor = UIColor.clearColor()
    @IBInspectable public var selectedTitleColor : UIColor = UIColor.whiteColor()
    
    // MARK : Private property
    private typealias CHButton = (button : UIButton, selected : Bool, selectedLayer : CALayer)

        daysButton.removeAll()
        
        self.daysLabel.forEach { currentDay in
            let button = UIButton(frame: CGRect(x: CGFloat(position) * itemWidth, y:0, width: itemWidth, height: itemHeight))
            let layer = CALayer()
            let tuple = CHButton(button, false, layer)
            
            configureButton(tuple: tuple, title: currentDay, position: position)
            configureLayer(tuple: tuple)
            daysButton.append(tuple)
            
            if position == defaultSelectedDay {
                selectDay(sender: button)
            }
            
            position += 1
