Xcode Version 14.1 beta 3 (14B5033e)
I have two changes from the example code:
- let image = imageLiteral(resourceName: "simon.png").cgImage( forProposedRect: nil, context: nil, hints: nil)!
I could not get that line to compile, so I used:
guard let inputCGImage = img.cgImage else { print("Can't create input CGImage") return }
2.vImageFloodFill_ARGB8888(src, tmp, seedX, seedY, &newARGB, 8, 0) I saw no variable named tmp created, and according to the documentation on the method (vImageFloodFill_ARGB8888) the tmp buffer will be created if you pass a nil. So I pass nil on that line.
I also wrap the whole thing in some display code to show an image, allow a tap, and apply the flood fill, return a new image, and display that.
Unfortunately... I get a single colored square (the size of the original image), not an image with a portion replaced with a new color.