Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create original done button #364

Closed
ghost opened this issue Jul 27, 2019 · 4 comments
Closed

How to create original done button #364

ghost opened this issue Jul 27, 2019 · 4 comments
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Jul 27, 2019

No description provided.

@ghost ghost added the question label Jul 27, 2019
@ghost ghost assigned TimOliver Jul 27, 2019
@ghost
Copy link
Author

ghost commented Jul 27, 2019

I have solved the problem myself.

@ghost ghost closed this as completed Jul 27, 2019
@twinkalGSensussoft
Copy link

twinkalGSensussoft commented Nov 28, 2019

How you have done this? Can you please give an explanation here? @ muranobu

@ghost
Copy link

ghost commented Nov 28, 2019

@twinkalGSensussoft
Hi, Sample code is here.

  1. Create original cropViewController.
let cropViewController = CropViewController(image: OriginalImage)
  1. Add cropViewController to Container View
self.addChild(cropViewController)
self.cropContainer.addSubview(cropViewController.view)
  1. Adjust cropViewController frame.
cropViewController.view.frame = CGRect(x: self.cropContainer.frame.origin.x, y: self.cropContainer.frame.origin.y, width: self.cropContainer.frame.width, height: self.cropContainer.frame.height)
  1. If you want to hide default toolbar, you must below code.
cropViewController.toolbar.isHidden = true
  1. Display cropViewController.
cropViewController.didMove(toParent: self)
  1. Define original done action and call doneButtonTapped!().
@IBAction func cropDoneButtonTUP(_ sender: UIButton) {       
      self.cropViewController.toolbar.doneButtonTapped!()
}

@twinkalGSensussoft
Copy link

What if I don't want only 90-degree rotation?. I want to add a rotation gesture to it, is it possible? If yes then please help me out.
thanks in advance.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants