Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ElegantEmojiPicker.podspec. #20

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

loongman
Copy link
Contributor

@loongman loongman commented Jun 2, 2023

To make it possible for this lib being able to be used via CocoaPods.

To make it possible for this lib being able to be used via CocoaPods.
@loongman
Copy link
Contributor Author

loongman commented Jun 2, 2023

Got below errors while i try to validate the podspec via:

pod spec lint ElegantEmojiPicker.podspec --allow-warnings --verbose

Screenshot 2023-06-02 at 13 36 56

Could you suggest how to proceed with? @Finalet

I understand that the source code works well with Swift Package Manager, however, to make it support CocoaPods as well, seems we should apply some adjustment to it.

It would be really cool if we can make this lib installable via CocoaPods due to its wide user base.

@Finalet
Copy link
Owner

Finalet commented Jun 2, 2023

Using Bundle.module is required for SPM to load external sources, like icons and json as seen in your error. My understanding is that you can use Bundle.main for CocoaPods. So using the #if SWIFT_PACKAGE preprocessor wherever necessary might help.

#if SWIFT_PACKAGE // SPM
let image = UIImage(named: "imade_name", in: .module, with: nil)
let bundle = Bundle.module 
#else // CocoaPods
let image = UIImage(named: "imade_name")
let bundle = Bundle.main
#endif

@Finalet Finalet linked an issue Jun 2, 2023 that may be closed by this pull request
@Finalet
Copy link
Owner

Finalet commented Jun 2, 2023

Also, I noticed you are using the git tag as the source:

s.source = { :git => 'https://github.com/Finalet/Elegant-Emoji-Picker.git', :tag => s.version }

I'm not using any tags in this repo, as distinct versions are not really important here. I think you would have to change it to pull from the main branch instead.

s.source = { :git => 'https://github.com/Finalet/Elegant-Emoji-Picker.git', :branch => `main` }

@loongman
Copy link
Contributor Author

loongman commented Jun 3, 2023

Seems version is required for podspec. Anyway, i have updated the podspec as you suggested. @Finalet

And handover the remaining parts to you to make it finally work.

  1. My understanding is we can specify one init version, 1.0.0, or 0.0.1, etc., to satisfy CocoaPods, then, leave the chance for user to use the lib via branch as you suggested, so that no need to add/maintain further versions/tags.
  2. Formally publish the podspec with pod trunk push command. Because you are the owner of this lib, so, the honor to do that belongs to you.
    (Pre-condition: setup an account on Cocoapods.org and register session using pod trunk register.)

Please feel free to let me know if you want me to take any further actions on that.

Screenshot 2023-06-03 at 12 01 20

@Finalet
Copy link
Owner

Finalet commented Jun 6, 2023

After multiple failed attempts to install cocoapods (some issues with the ruby manager on my mac), I wondered the rationality of what we are doing.

SPM can be used together with CocoaPods in the same project (like here), and it's a more modern, convenient package manager. So what are the benefits of maintaining CocoaPods separately?

Thank you for your help and effort! But I don't really understand why, @loongman.

@loongman
Copy link
Contributor Author

  1. Flexibility.
    By supporting CocoaPods, we do not force users who already use CocoaPods in them project to switch to SPM + CocoaPods, even though SPM + CocoaPods might work well together. Actually, in my case, there is conflict while i try to use this lib by introducing SPM + CocoaPods into my project.

  2. Increasing the possibilities for more users to use this lib.
    As you mentioned on Readme, why is there no built in emoji picker in UIKit? This lib fills the gap well, it can help a good number of users and them projects for sure.

Personally, i have been searching for such a lib for quite a while by using pod search, it did not guide me to here due to this lib's lack of CocoaPods support.
Luckily and coincidentally, after a bundle of google search, finally, i got to here via https://iosexample.com/a-simple-and-powerful-emoji-picker-for-swift-built-with-uikit/

If we can add CocoaPods support to this lib, pod search can help much more users to reach to this lib. And the only thing we need to do is to add a podspec file and publish it the pod world. @Finalet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CocoaPods support.
2 participants