Open loongman opened 1 year ago
Got below errors while i try to validate the podspec via:
pod spec lint ElegantEmojiPicker.podspec --allow-warnings --verbose
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.
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
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` }
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.
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.
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.
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.
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
To make it possible for this lib being able to be used via CocoaPods.