데이터분석/Code & Tools & Script Snippet
Swift 4 - Read CGImage File
늘근이
2018. 5. 17. 22:41
If you are experiencing any trouble reading image file into the Mac OS app,
you are probably using sandbox.
if you execute your CGImage() init method in your sandbox environment, app does not do anything. no error message, no nothing.
using Data() will let you know that you don't have any permission to access the file out of the sandbox. turn the damn option off
Playground is also executing the file in the context of sandbox. No way to turn it off, but if you are building the app using Cocoa framework, just turn your sandbox option off.