I know how to clear the imageView when panning but when I do it clears the image with sharp edges but what I want is to clear the ImageView with soft/smooth edges when panning on the ImageView in iOS using Swift3 ? Hope I am clear with my question.
//For clearing the imageView I use this method.
func draw(fromPoint:CGPoint,toPoint:CGPoint) {
if draw {
UIGraphicsBeginImageContext(self.viewBelowScrollView.bounds.size)// ??
let context = UIGraphicsGetCurrentContext()
frontImageView.image?.draw(in: self.viewBelowScrollView.bounds)
context?.setLineCap(CGLineCap.round)
context?.setLineWidth(CGFloat(sizeSliderOutlet.value))
context?.move(to: CGPoint(x: fromPoint.x, y: fromPoint.y))
context?.addLine(to: CGPoint(x: toPoint.x, y: toPoint.y))
context?.setBlendMode(CGBlendMode.clear)
//Setting the Line Configuration
context?.strokePath()
//Setting all the things done on the Image View Now.
frontImageView.image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
}
}
//Any help will be highly appreciated. Thank you in advance.