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

Dear Author, can I get the special ratio with NSPredicate ? #347

Open
brandy2015 opened this issue Nov 29, 2022 · 1 comment
Open

Dear Author, can I get the special ratio with NSPredicate ? #347

brandy2015 opened this issue Nov 29, 2022 · 1 comment

Comments

@brandy2015
Copy link

let options = PHFetchOptions()
options.predicate = NSPredicate(format: "pixelHeight / pixelWidth == %d", 2)
configure.fetchOption = options

It doesn't work.

Wanna get 1:2 pixelHeight : pixelWidth

@brandy2015
Copy link
Author

func canSelectAsset(phAsset: PHAsset) -> Bool {
if (phAsset.pixelWidth / phAsset.pixelHeight) == 2 || (Double(phAsset.pixelWidth) / Double(phAsset.pixelHeight)) == 0.5{
return true
}
}

it's not enough

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

1 participant