ImageCropper
ImageCropper copied to clipboard
Can't make zoom
Hello there,
I'm trying to make zoom in my cropper view controller. But it still in the normal size. What could be happening?
Best Regards
HI, me too - I see can run through debug and I see the following method is called, but nothing happens:
func setImageFrame(_ frame: CGRect) { imgCropping.frame = frame }
(related PR #12)
the problem is image is updating its frame in layoutSubViews with its original Frame so the solution is to make Bool variable and set it to false then make init first time and set it to true meanwhile in your code check if its not first time don't update frame with its original frame
in ImageCropperPresenter.swift
add this line of code to variables
fileprivate var isSetInitial = false
then in viewDidLayoutSubviews update with this code
if !isSetInitial { view?.setImageFrame(model.imageInitialFrame) } isSetInitial = true