Crop square image in hexagons with quick
1 answer
You will need to create a shape and save it as an image and then create an image mask. This is part of the code I used to do the same, but you will need to create your own size and straight variables. Hope this helps.
UIGraphicsBeginImageContext(size)
UIImage(CGImage: originalImage!).drawInRect(rect)
maskImage.drawInRect(rect, blendMode: CGBlendMode.DestinationIn, alpha: 1.0)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
imageView.image = newImage
+1
source to share