Giter VIP home page Giter VIP logo

Comments (5)

zhangao0086 avatar zhangao0086 commented on May 26, 2024

Hi @kshan

The type of fullScreenImage is Optional, maybe you have to check it nil or not like this:

if let fullScreenImage = asset.fullScreenImage {
    // do something...
}

Thanks for your used :)
Closing the thread... Let me know if you have any other questions :)

from dkimagepickercontroller.

kshan avatar kshan commented on May 26, 2024

@zhangao0086 Thanks for your prompt reply. I found the solution to this in my case.

Crash happen to that I post data to server via fullScreenImage, but use thumbnailImage in collectionview after picks phtos, even if unwrapping an optional value. If i use fullScreenImage in collectionview too, it's normal.

from dkimagepickercontroller.

zhangao0086 avatar zhangao0086 commented on May 26, 2024

Thanks for your detail!

Could you make a test? Change these line:

public private(set) lazy var fullScreenImage: UIImage? = {
    return UIImage(CGImage: self.originalAsset?.defaultRepresentation().fullScreenImage().takeUnretainedValue())
}()

to that:

public private(set) lazy var fullScreenImage: UIImage? = {
    return UIImage(CGImage: self.originalAsset?.defaultRepresentation().fullScreenImage(). takeRetainedValue())
}()

I think this will resolve your issue. Let me know if that works. TIA :)

from dkimagepickercontroller.

nishantdongare avatar nishantdongare commented on May 26, 2024

Hello @zhangao0086 . I tried to do this . But this is also not working. I am using iOS 9.0

from dkimagepickercontroller.

zhangao0086 avatar zhangao0086 commented on May 26, 2024

Hi @nishantdongare @kshan

The issue has been fixed. Here is my solution:

  1. Define the library as a singleton property:static private let library = ALAssetsLibrary()
  2. Replace self.library.enumerateGroupsWithTypes... with self.dynamicType.library.enumerateGroupsWithTypes...

This will always use the same library for all accesses to the assets.
Let me know if you have any other questions :)

from dkimagepickercontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.