LeoNatan / LNPopupController

A framework for presenting view controllers as popups of other view controllers, much like the Apple Music and Podcasts apps.
MIT License
3.04k stars 342 forks source link

SPM Support? #387

Closed muhasturk closed 4 years ago

muhasturk commented 4 years ago

Quite simple to add Package.swift and point source files. Could you please add swift package manager support?

LeoNatan commented 4 years ago

Hello, I don't have much experience with it. Would you be interested in submitting a PR and updating the docs with an explanation how to install?

Thanks

muhasturk commented 4 years ago

Ok, let me develop, will send PR.

LeoNatan commented 4 years ago

Just to be sure, does SPM guarantee a framework output with a module, so things like @import LNPopupController; are handled correctly?

Also, the framework currently has an asset catalog. SPM doesn't currently support assets. I read that Swift 5.3 will finally add that in SPM, so maybe best to wait until then.

https://github.com/LeoNatan/LNPopupController/blob/821b5b61a959570adcf13a4475566603fbb27f4a/LNPopupController/LNPopupController/Private/LNPopupCloseButton.m#L97

muhasturk commented 4 years ago

You are right, 5.3 will add support for Binary Dependencies, we can wait until released.

https://github.com/apple/swift-evolution/blob/master/proposals/0272-swiftpm-binary-dependencies.md

LeoNatan commented 4 years ago

It’s mind boggling that it took so long to develop this. 🤦‍♂️

fruitcoder commented 4 years ago

Binary dependencies and resources are now supported in SPM :)

LeoNatan commented 4 years ago

Hmm, so it requires that all sources be in Sources/? :(

I might implement this using soft links, I don't like losing history on the files just for SPM.

LeoNatan commented 4 years ago

I've created the SPM branch with my attempt:

https://github.com/LeoNatan/LNPopupController/tree/SPM https://github.com/LeoNatan/LNPopupController/blob/SPM/Package.swift

Can't get the build system to find my public headers. I am using #import <LNPopupController/Header.h> syntax for publicly exposed headers, but Xcode complains that it cannot find the header. I will not change the import syntax to #import "Header.h".

@muhasturk @fruitcoder If you'd like to assist here, I'd be grateful.

LeoNatan commented 4 years ago

Got it working.

fruitcoder commented 4 years ago

Oh wow @LeoNatan that's amazing 🥳

LeoNatan commented 4 years ago

Cheers!

funkenstrahlen commented 4 years ago

Thank you for supporting this :)