You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The button doesn't appear as expected when subclassed and used with @IBInspectable variables to set up the values for configureButtonStyles like here:
import UIKit
import SimpleButton
@IBDesignableclassDesignableButton:SimpleButton{/// Background color for normal state.@IBInspectablevarbackgroundColorNormal:UIColor?@IBInspectablevarbackgroundColorHighlight:UIColor?@IBInspectablevartitleColorNormal:UIColor?@IBInspectablevartitleColorHighlighted:UIColor?@IBInspectablevarshadow:Bool= false
@IBInspectablevarshadowColor:UIColor?@IBInspectablevarshadowOffset:CGSize= CGSizeZero
@IBInspectablevarshadowRadius:CGFloat=0@IBInspectablevarshadowOpacity:Float=0overridefunc configureButtonStyles(){
super.configureButtonStyles()
if let backgroundColorNormal = backgroundColorNormal {setBackgroundColor(backgroundColorNormal, forState:.Normal)}
if let backgroundColorHighlight = backgroundColorHighlight {setBackgroundColor(backgroundColorHighlight, forState:.Highlighted)}
if let titleColorNormal = titleColorNormal {setTitleColor(titleColorNormal, forState:.Normal)}
if let titleColorHighlighted = titleColorHighlighted {setTitleColor(titleColorHighlighted, forState:.Highlighted)}
if shadow {
if let shadowColor = shadowColor {setShadowColor(shadowColor)}setShadowOffset(shadowOffset)setShadowRadius(shadowRadius)setShadowOpacity(shadowOpacity)}}}
The text was updated successfully, but these errors were encountered:
The button doesn't appear as expected when subclassed and used with
@IBInspectable
variables to set up the values forconfigureButtonStyles
like here:The text was updated successfully, but these errors were encountered: