-
Notifications
You must be signed in to change notification settings - Fork 170
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
Open up CropViewController for inhertiance. #274
Conversation
If you want that Mantis creates an instance of a subclass CropViewController, maybe we can add an API like below public func cropViewController<T: CropViewController>(image: UIImage,
config: Mantis.Config = Mantis.Config(),
cropToolbar: CropToolbarProtocol = CropToolbar(frame: .zero)) -> T {
let cropViewController = T(config: config)
cropViewController.cropView = buildCropView(with: image, and: config.cropViewConfig)
cropViewController.cropToolbar = cropToolbar
return cropViewController
} |
03d665e
to
149cf64
Compare
149cf64
to
3865416
Compare
Do you want it like this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
I added a couple of more comments.
@vanniktech |
f65ffd2
to
a9f169b
Compare
Like this? |
```swift | ||
let cropViewController: CustomViewController = Mantis.cropViewController(image: image, config: config) | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Thanks for adding this 👍
Hi @vanniktech |
Oh yes! I didn't see that comment. |
References #270
My main goal is to have my own version of
CropViewController
which behaves a bit different as the actions are in the navigation bar. So all of the set up code can go into its own Controller. Also in my own ViewController I'd also link my features together and implement other interfaces that belong to the image editing section.