1

I'm new in Swift and i want your help please.

I am writing a code from an tutorial swift 2 and i want to write in swift 4.

    let imgManager = PHImageManager.default()
    let requestOptions = PHImageManager()
    requestOptions.synchronous = true  //error:Value of type 'PHImageManager' has no member 'synchronous'
    requestOptions.deliveryMode = .highQualityFormat   // error:Value of type 'PHImageManager' has no member 'deliveryMode'
3
  • Could you show the PHImageManager function? Commented Jun 8, 2018 at 9:24
  • 1
    Typo? I don’t know the API but it looks like you have to write something like let requestOptions = PHImageRequestOptions(). Two different instances of PHImageManager right after another doesn’t make any sense. Commented Jun 8, 2018 at 9:25
  • Replace PHImageManager to PHImageRequestOptions Commented Jun 8, 2018 at 9:26

1 Answer 1

3

It should be like this,

let imgManager = PHImageManager.default()
let requestOptions = PHImageRequestOptions()
requestOptions.isSynchronous = true
requestOptions.deliveryMode = .highQualityFormat

requestoptions is PHImageRequestOptions() not PHImageManager()

Please read more about PHImageManager apple class reference

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.