Now I have a rectangle inside of which I resize and crop my image:
UIGraphicsBeginImageContextWithOptions((scrollView?.bounds.size)!, true, UIScreen.mainScreen().scale)
let offset = scrollView?.contentOffset
CGContextTranslateCTM(UIGraphicsGetCurrentContext(), -(offset?.x)!, -offset!.y)
scrollView!.layer.renderInContext(UIGraphicsGetCurrentContext()!)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
For whole my controller please look at this Pastebin
So, my question is, how can I make like in Instagram, like this:
How to add black rectangle with the circle center and continue resize my image as I do it now?