Open LoveCorner opened 7 years ago
通过代理方法去控制
func assetsPickerController(_ picker: CTAssetsPickerController, didSelect asset: PHAsset) {
imageCount += 1
}
func assetsPickerController(_ picker: CTAssetsPickerController, didDeselect asset: PHAsset) {
imageCount -= 1
}
//是否可以选中
func assetsPickerController(_ picker: CTAssetsPickerController, shouldSelect asset: PHAsset) -> Bool {
if imageCount >= 3 {
return false
}
return true
}
可以设置限制的张数吗