                 NSNotificationCenter.defaultCenter().postNotificationName(name!, object: scopeObject)  // todo scope
             }
         }
-        
-        /*if isToggle {
-            sender.selected = !sender.selected;
-        }*/
     }
     
     @objc func buttonOnTouchDown(sender:UIButton!)

            button.setBackgroundImage(img, forState: .Disabled)
        }
		
		if backgroundColor != nil {
			button.backgroundColorNormal = backgroundColor!
		}
        if backgroundColorHighlighted != nil {
            button.backgroundColorHighlighted = backgroundColorHighlighted!
        }
        if backgroundColorSelected != nil {
            button.backgroundColorSelected = backgroundColorSelected!
        }
        if backgroundColorSelectedHighlighted != nil {
            button.backgroundColorSelectedHighlighted = backgroundColorSelectedHighlighted!
        }
        if backgroundColorDisabled != nil {
            button.backgroundColorDisabled = backgroundColorDisabled!
        }
        
        button.isToggle = isToggle
    }

        }
        
        if backgroundImage != nil {
            let img = UIImage(named: String(bundlePath: backgroundImage!))
            button.setBackgroundImage(img, forState: .Normal)
        }
        if backgroundImageHighlighted != nil {
            let img = UIImage(named: String(bundlePath: backgroundImageHighlighted!))
            button.setBackgroundImage(img, forState: .Highlighted)
        }
        if backgroundImageSelected != nil {
            let img = UIImage(named: String(bundlePath: backgroundImageSelected!))
            button.setBackgroundImage(img, forState: .Selected)
        }
        if backgroundImageSelectedHighlighted != nil {
            let img = UIImage(named: String(bundlePath: backgroundImageSelectedHighlighted!))
            button.setBackgroundImage(img, forState: .Selected | .Highlighted)
        }
        if backgroundImageDisabled != nil {
            let img = UIImage(named: String(bundlePath: backgroundImageDisabled!))
            button.setBackgroundImage(img, forState: .Disabled)
        }
        
        if image != nil {
            let img = UIImage(named: String(bundlePath: image!))
            button.setImage(img, forState: .Normal)
        }
        if imageHighlighted != nil {
            let img = UIImage(named: String(bundlePath: imageHighlighted!))
            button.setImage(img, forState: .Highlighted)
        }
        if imageSelected != nil {
            let img = UIImage(named: String(bundlePath: imageSelected!))
            button.setImage(img, forState: .Selected)
        }
        if imageSelectedHighlighted != nil {
            let img = UIImage(named: String(bundlePath: imageSelectedHighlighted!))
            button.setImage(img, forState: .Selected | .Highlighted)
        }
        if imageDisabled != nil {
            let img = UIImage(named: String(bundlePath: imageDisabled!))
            button.setImage(img, forState: .Disabled)
        }
        
        if imageSet != nil {
            let pathLength = countElements(imageSet!)
            let extensionLength = countElements(imageSet!.componentsSeparatedByString(".").last!)
            let insertPosition = pathLength - extensionLength - 1
            
            let normalPath = imageSet!.substringToIndex(advance(imageSet!.startIndex, insertPosition)) + "_normal" + imageSet!.substringFromIndex(advance(imageSet!.startIndex, insertPosition))
            let highlightedPath = imageSet!.substringToIndex(advance(imageSet!.startIndex, insertPosition)) + "_highlighted" + imageSet!.substringFromIndex(advance(imageSet!.startIndex, insertPosition))
            let selectedPath = imageSet!.substringToIndex(advance(imageSet!.startIndex, insertPosition)) + "_selected" + imageSet!.substringFromIndex(advance(imageSet!.startIndex, insertPosition))
            let selectedHighlightedPath = imageSet!.substringToIndex(advance(imageSet!.startIndex, insertPosition)) + "_selected_highlighted" + imageSet!.substringFromIndex(advance(imageSet!.startIndex, insertPosition))
            let disabledPath = imageSet!.substringToIndex(advance(imageSet!.startIndex, insertPosition)) + "_disabled" + imageSet!.substringFromIndex(advance(imageSet!.startIndex, insertPosition))
            
            var img: UIImage? = UIImage(named: String(bundlePath: normalPath))
            if img == nil {
