iosuikitios11uigraphicscontextheif

Generate HEIF data using UIGraphicsImageRenderer in iOS 11


I just watched this WWDC talk, and while I'm very excited to adopt HEIF they didn't mention UIGraphicsRenderer at all. After scanning the header for the UIGraphics*Renderer classes, I didn't see anything notable there either. Is there a way to use UIGraphicsImageRenderer to get HEIF data back on devices running iOS 11?


Solution

  • You can't do it directly with UIGraphicsImageRenderer, but I wrote a wrapper here that let's you convert UIImages to HEIC: https://github.com/timonus/UIImageHEIC