7.如何使用Eureka社区中的第三方库
Eureka的社区在此:
https://github.com/EurekaCommunity
里面有很多人分享的第三方Row哦。我们挑一个简单说说怎么用,就拿ColorPickerRow来说事吧!
- 打开之前项目的Podfile,添加如下两行指令
pod 'ColorPickerRow', :git => 'https://github.com/EurekaCommunity/ColorPickerRow' pod 'UIColor_Hex_Swift'
- 在console中运行install命令:
pod install
- 打开项目,进入ViewController文件,在文件开头添加引用:
import ColorPickerRow
- 在之前的代码末尾添加如下内容:
<<< InlineColorPickerRow("colors"){row in row.title = "Color Picker" row.isCircular = true row.showsPaletteNames = true row.value = .red }
运行一下看看: