1
我有一个通过PaintCode绘制的图标。我需要以编程方式在XCode中更改他的颜色。如何通过PaintCode&Xcode使用颜色变量
在PaintCode上,我将变量“ChevronColor”设置为描边颜色。
现在我有:
@IBDesignable
class IconClass: UIView {
override func draw(_ rect: CGRect) {
StyleKit.drawIcon(frame: self.bounds, resizing: .aspectFit)
}
}
但我想补充的这种,能够设置图标的颜色。
@IBInspectable
var ChevronColor : UIColor {
didSet (newColor) {
setNeedsDisplay()
}
}
我不知道该怎么做。
导出StyleKit文件后,我除外有在stylekit文件中可用此方法,但它并非如此:
StyleKit.drawIcon(frame: self.bounds, resizing: .aspectFit, chevronColor: self.ChevronColor)
作品完美的感谢! – cmii