A friend of mine had to draw a mandelbrot with opengl in c. I decided to do it in Swift.
The first method I tried was by creating an array with ARGB data and convert this into a CGImage and view that one in an UIImageView. However this was not fast enough.
Now I am wondering, what is the fastest way to draw individual pixels onto the screen. I looked into Metal but that seemed to be mostly about triangles and 3d stuff. Then I came to scenekit shaders (.fsh) and thought maybe that was a good solution. However I want also be able to zoom into the mandelbrot fractal and I couldnt find a way to input variables in my mandelbrot (my reference: https://www.weheartswift.com/fractals-xcode-6/)
Can you guys tell me/give an example (Swift please) on the fastest way of drawing individual pixels, or at least a way to draw raw pixels to the screen without having to use something intermediate like composing a CGImage?