title: how to change the button colour if checkbox is checked in swift?
body: <p>I have a agree button below two checkbox. i want to enable the agree button and also change the colour of agree button after both checkbox is checked. i have used custom images for checkbox.
      i am using this code</p>
  
  <p>This is my UIButton class</p>
  
  <pre><code>let selectedImage = UIImage(named: "checkbox_checked")
  let unselectedImage = UIImage(named: "checkbox_unchecked")
  
  
  class Qbutton: UIButton {
  
      //Bool Property
      var isChecked:Bool = false{
          didSet{
              if isChecked {
                  self.setImage(selectedImage, forState: UIControlState.Normal)
              }else{
                  self.setImage(unselectedImage, forState: UIControlState.Normal)
          }
      }
      }
      override init(frame: CGRect){
          super.init(frame:frame)
          self.layer.masksToBounds = true
          self.setImage(unselectedImage, forState: UIControlState.Normal)
  
          self.addTarget(self, action: "buttonClicked:", forControlEvents: UIControlEvents.TouchUpInside)
          self.isChecked = false
      }
  
      required init(coder aDecoder: NSCoder) {
          super.init(coder: aDecoder)!
      }
  
      func buttonClicked(sender: UIButton) {
          if(sender == self){
              if isChecked == true{
                  isChecked = false
                  print("true")
                  self.setImage(unselectedImage, forState: UIControlState.Normal)
              }else{
                  isChecked = true
                  print("false")
                  self.setImage(selectedImage, forState: UIControlState.Selected)
  
              }
              NSUserDefaults.standardUserDefaults().setObject(isChecked, forKey: "isBtnChecked")
              NSUserDefaults.standardUserDefaults().synchronize()
          }
      }
  
  }
  </code></pre>
  
  <p>AND THIS IS MY VIEW CONTROLLER CLASS WHERE I AM USING QBUTTON CLASS</p>
  
  <pre><code>checkBoxOne = Qbutton(frame: CGRectMake(X,Y,WIDTH,HEIGHT))
          isChecked = NSUserDefaults.standardUserDefaults().boolForKey("isBtnChecked")
          checkBoxOne.isChecked = isChecked
          self.view.addSubview(checkBoxOne)
  
  checkBoxTwo = Qbutton(frame: CGRectMake(X,Y,WIDTH,HEIGHT))
          checkBoxTwo.isChecked = isChecked
          self.view.addSubview(checkBoxTwo)
  </code></pre>
  
  <p>NOW I WANT TO CHANGE THE COLOR OF AGREE BUTTON IF USER CHECK BOTH THE CHECKBOXES.</p>