iOS swift- UI控件添加晕影

//UI控件添加晕影

class func YhySheZhiYinYingBianKuang(_ AnyUI:Any,shuzhi1 :Float,shuzhiyanse:UIColor,shuzhiwidth : CGFloat

,shuzhiheight:CGFloat,shuzhi4:CGFloat) -> () {

//晕影程度

(AnyUI as AnyObject).layer.shadowOpacity = shuzhi1

//晕影颜色

(AnyUI as AnyObject).layer.shadowColor = shuzhiyanse.cgColor

//晕影范围

(AnyUI as AnyObject).layer.shadowOffset = CGSize(width: shuzhiwidth, height: shuzhiheight)

//圆角度

(AnyUI as AnyObject).layer.cornerRadius = shuzhi4


}

}

你可能感兴趣的:(iOS swift- UI控件添加晕影)