ColorPicker
是一个用于选择颜色的 UI 组件。
Swift 6
iOS 15
import ColorPicker
...
let vc = ColorPickerViewController()
vc.setDelegate(self)
present(vc, animated: true)
let vc = ColorPickerViewController()
var configuration = ColorPickerConfiguration.default
configuration.initialColor = .red
configuration.initialColorItems = [.init(id: UUID(), color: .red)]
vc.configuration = configuration
vc.setDelegate(self)
present(vc, animated: true)
extension ContentViewController: ColorPickerViewControllerDelegate {
func colorPickerViewControllerDidFinish(_ viewController: ColorPickerViewController) {
print(#function, viewController.selectedColor)
}
func colorPickerViewController(_ viewController: ColorPickerViewController, didSelect color: UIColor, continuously: Bool) {
print(#function, color, continuously)
}
}
ColorPicker 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。
禁止为了伪装垃圾邮件帐户的活动为合法帐户而进行 Fork 或贡献。