alexiscreuzot / SwiftyGif

High performance GIF engine
MIT License
2.02k stars 212 forks source link

Compiler error "Value of optional type 'UnsafeMutableRawPointer?' not unwrapped" #67

Closed Khronoss closed 5 years ago

Khronoss commented 6 years ago

In UIImage+SwiftyGif, I've got the compiler complaining that those values have to be unwrapped be cause they are optionals: _imageSourceKey, _displayRefreshFactorKey, _imageCountKey, _displayOrderKey, _imageSizeKey, _imageDataKey

The thing is that they are instantiated with malloc that returns a forced unwrapped pointer, but as the declaration does not explicitly mark the value as being implicitly forced unwrapped, the compiler assume that they are optionals instead :/

I'm using SWIFT 4, and cocoapods 1.3.1