This is a very quick one. For an app I’m working on I wanted to measure how long it took a given function to complete. I typically don’t do this, as most functions are very fast, but this one involved a server fetch and some background processing. Anyhow, I’m getting distracted, here it is -easy …
Monthly Archives: October 2018
Dealing with UIGraphics ImageContext ‘Memory Leaks’
Here’s the code to change the image size of an image in iOS so that then it can be saved with smaller footprint: let rect = CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height) // Actually do the resizing to the rect using the ImageContext stuff UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0) image.draw(in: rect) …
Continue reading “Dealing with UIGraphics ImageContext ‘Memory Leaks’”