轻量级渐变UILabel和UIButton解决方法
pod 'GradientX'
Usage
//MARK: - Label
let label = GradientLabel()
///更改颜色
label.new(colors: [UIColor.red.cgColor, UIColor.black.cgColor, UIColor.white.cgColor])
/// 更改方向
label.new(direction: .vertical)
//MARK: - Button
let button = GradientButton()
///更改颜色
button.new(colors: [UIColor.red.cgColor, UIColor.black.cgColor, UIColor.white.cgColor])
/// 更改方向
button.new(direction: .vertical)
Storyboard

ScreenShots

网友评论