AMColorPicker 可以通过以下三种方式选择颜色。
演示
| 轮盘 | 表格 | 滑动条 |
|---|---|---|
![]() |
![]() |
![]() |
使用
在类声明中采用 AMColorPickerDelegate 协议。
class ViewController: UIViewController, AMColorPickerDelegate在类实现中遵守该协议。
func colorPicker(_ colorPicker: AMColorPicker, didSelect color: UIColor) {
// use selected color here
}根据需要创建并显示 AMColorPicker。
let colorPickerViewController = AMColorPickerViewController()
colorPickerViewController.selectedColor = .red
colorPickerViewController.delegate = self
present(colorPickerViewController, animated: true, completion: nil)自定义
AMColorPicker 可以通过以下属性进行自定义。
public var selectedColor: UIColor = .white
public var isCloseButtonShown: Bool = true
public var isSelectedColorShown: Bool = true模态
| 轮盘 | 表格 | 滑动条 |
|---|---|---|
![]() |
![]() |
![]() |
推送
| 轮盘 | 表格 | 滑动条 |
|---|---|---|
![]() |
![]() |
![]() |
弹出窗口
最小高度为380。
| 轮盘 | 表格 | 滑动条 |
|---|---|---|
![]() |
![]() |
![]() |
暗黑模式
| 轮盘 | 表格 | 滑动条 |
|---|---|---|
![]() |
![]() |
![]() |
安装
CocoaPods
将以下内容添加到您的Podfile中。
pod 'AMColorPicker'
Carthage
将以下内容添加到您的Cartfile。
github "adventam10/AMColorPicker"
许可协议
MIT
















