TOCropViewController icon indicating copy to clipboard operation
TOCropViewController copied to clipboard

2.5.3 SPM Won't compile

Open tristangrichard opened this issue 4 years ago • 10 comments

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'
.....

tristangrichard avatar Jul 17 '20 12:07 tristangrichard

Same happens here

waldo9 avatar Jul 18 '20 09:07 waldo9

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!

TimOliver avatar Jul 20 '20 07:07 TimOliver

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 :-/

jeffreybergier avatar Jul 20 '20 07:07 jeffreybergier

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. 😅

TimOliver avatar Jul 20 '20 07:07 TimOliver

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.

jeffreybergier avatar Jul 20 '20 07:07 jeffreybergier

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"

jeffreybergier avatar Jul 20 '20 08:07 jeffreybergier

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

Harout360 avatar Jul 28 '20 04:07 Harout360

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. :)

TimOliver avatar Jul 28 '20 06:07 TimOliver

Xcode 12 is now out.

ethanwa avatar Sep 28 '20 15:09 ethanwa

So it is! 😆

(Were you going somewhere with that? 😝)

TimOliver avatar Oct 11 '20 02:10 TimOliver