Tocropviewcontroller: 2.5.3 SPM Won't compile

Created on 17 Jul 2020  ·  10Comments  ·  Source: TimOliver/TOCropViewController

Describe the bug
2.5.3 with SPM won't build
Xcode 11.6
To Reproduce
Steps to reproduce the behavior:
Remove 2.5.2 from carthage folder
Add 2.5.3 to SPM

Expected behavior
Projects builds

Behaviour
CropViewController.swift

Use of undeclared type 'TOCropViewControllerAspectRatioPreset'
Use of undeclared type 'TOCropViewControllerToolbarPosition'
Use of undeclared type 'TOCropViewCroppingStyle'
@objc attribute used without importing module 'Foundation'
.....
bug rfc

Most helpful comment

Awesome! Thanks for that @Harout360! I just merged your changes in. Thanks for confirming it's working.

I've stored @jeffreybergier's original changes into a separate branch now, so when Xcode 12 is properly out, we can revisit this then. :)

All 10 comments

Same happens here

Thanks for the feedback folks! I just merged in a new PR by @jeffreybergier and cut a new release of v2.5.4.

Jeff did uncover one specific quirk I didn't know about. Xcode 11 doesn't support SPM packages that contain resources (This project has localisation strings). The PR he submitted gets resources working in Xcode 12, but until Xcode 12 has left beta, it's worth pointing out that this library is stuck in English if you install it via SPM.

Please give v2.5.4 a shot and tell me how it goes!

Actually, with the merged changes it won't work via SPM in Xcode 11. It will complain about swift version. Swift 5.3 and Xcode 12 are required to include this package via SPM. Sorry. Its just a technical limitation of SPM :-/

Uhhh. Oh no. Really? There's no backwards compatibility at all?

Um, okay. I'm open to suggestions on the best way of supporting this then. 😅

I think you'll need to keep an xcode11 branch alive to keep backwards compatibility. Or revert the changes, and then create an xcode12 branch that is ready to merge when Xcode 12 goes out of beta.

but yeah. I almost question supporting SPM in Xcode 11 as it doesn't support localizations... which is pretty bad. Like it could be a bad mistake for a developer to make... thinking they can switch from Cocoapods to SPM and get the same functionality (which I think is a totally fair assumption). I think it makes a clearer stance to say "because of technical limitations of SPM and localizations, I can only support Xcode 12 and higher for SPM"

https://github.com/TimOliver/TOCropViewController/pull/425 removed localization support on this PR, building for me now on 11.6

Awesome! Thanks for that @Harout360! I just merged your changes in. Thanks for confirming it's working.

I've stored @jeffreybergier's original changes into a separate branch now, so when Xcode 12 is properly out, we can revisit this then. :)

Xcode 12 is now out.

So it is! 😆

(Were you going somewhere with that? 😝)

Was this page helpful?
0 / 5 - 0 ratings