WeTransfer / WeScan

Document Scanning Made Easy for iOS
MIT License
2.87k stars 561 forks source link

Reorganization of navigation code #107

Closed echamussy closed 5 years ago

echamussy commented 5 years ago

Hi. I'm thinking to add WeScan to a new project I'm working on but the structure of the navigation code seems like it could be improved especially towards supporting multi page scanning. My suggestion in particular is to make the 'ScannerViewController', 'EditScanViewController' independent from a navigation controller navigation. In the ScannerViewController instead of pushing to the EditScanViewController we could create a protocol with a method like

func scannerViewController(_ scannerViewController:ScannerViewController didCapturePicture picture: UIImage, withQuad quad: Quadrilateral?)

This protocol could be then implemented by the ImageScannerController to push the EditScanViewController but it would also allow to implement your own navigation if the ScannerViewController was to be invoked individually rather than via the ImageScannerController nav controller.

This would also allow to keep the user in the ScannerViewController to support multi page scanning and then show all images scanned in a different controller (similar to what the Scanner PRO from Readdle app does)

Let me know your thoughts. I can try implementing this changes and submit a pull request but I want to know your thoughts first.

Thanks for your great work on this library!

julianschiavo commented 5 years ago

Hey, this is already being worked on in issue #11 - if that’s what you wanted it would be best to close this issue so all the discussion is kept in one place 🙂

echamussy commented 5 years ago

Thanks for your comment. Ok, I will close this and I will write my comment on issue #11 to keep the discussion in one place. Cheers.

julianschiavo commented 5 years ago

Awesome, thanks!