Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

限制选择的张数 #247

Open
LoveCorner opened this issue Apr 22, 2017 · 1 comment
Open

限制选择的张数 #247

LoveCorner opened this issue Apr 22, 2017 · 1 comment

Comments

@LoveCorner
Copy link

可以设置限制的张数吗

@kk-vv
Copy link

kk-vv commented Jun 20, 2017

通过代理方法去控制

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
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants