jonreid / ViewControllerPresentationSpy

Unit test presented and dismissed iOS view controllers, including alerts and action sheets
MIT License
149 stars 15 forks source link

Swift Package Manager Support #11

Closed ataias closed 1 year ago

ataias commented 3 years ago

I couldn't find any info on the README about swift package manager support (and didn't see a Package.swift file either). Is there any particular reason for that? Just wasn't looked into or is there a bigger issue?

SimonNumberTwo commented 2 years ago

Would be great to have SPM support. Tried it with a fork but this would result in a major refactoring and didn't want to go too far without asking the maintainer. I guess as SPM currently does not allow Objective-c and Swift files to be mixed.

Are you planning to add SPM as a further dependency manager?

SimonNumberTwo commented 2 years ago

Hey @ataias I tried migrating the project to SPM in my fork but get a lot of Could not find issues. I am uncertain if we can fully migrate the framework but if you have time to have a look into it I would highly appreciate it.

So far what I found out is that the Objective-c part is dependent on the Swift part due to the ClosureContainer and I needed to separate the Objective-C and Swift files as SPM does not support mixed language dependencies. I then made a separate target for the Objective-C code and added it as a dependency to the Swift target resulting in a missing ViewControllerPresentationSpy-Swift.h file due to the Objective-C part not having a Swift file which is required to generate to do so.

I am kind of stuck here and help would be highly appreciated. Please share your thoughts or maybe @jonreid has any experience with mixed language projects being available with SPM.

Thank you very much in advance.

jonreid commented 2 years ago

My guess is that I should rewrite the original Objective-C implementation into Swift. That'll solve things for most folks using SPM, because most of them are probably using Swift. Will this "just work" for Obj-C, or will we need a thin wrapper? Don't know until we get there.

SimonNumberTwo commented 2 years ago

Thanks for your reply Jon. I would highly appreciate your work on rewriting the framework into Swift. If I am of any help let me know.

Looking forward to seeing your great work.

nicholausadi commented 2 years ago

Hi, any updates regarding SPM?

Thankyou

jonreid commented 2 years ago

I've begun the conversion as a live-coding project on Twitch. https://www.youtube.com/playlist?list=PL-NrXVEjQ-o8grWHkuyeDk1TZN--VwX7m

devuzan commented 2 years ago

I've begun the conversion as a live-coding project on Twitch. https://www.youtube.com/playlist?list=PL-NrXVEjQ-o8grWHkuyeDk1TZN--VwX7m

thanks in advance, Jon

jonreid commented 1 year ago

Now available!