I have created a library in Swift and is trying to upload the library to cocoapods(I am not sure if this is possible, but I assume it has to be). I have never uploaded a library to cocoapods before, so I am unaware of how to do this. I already have the library up in GitHub.
This is what I tried:
Opened the terminal and typed in the following command:
pod spec create JHProgressHUD
This created a JHProgressHUD.podspec
file. I replaced the entire default contents of the file with the following:
Pod::Spec.new do |spec|
spec.name = 'JHProgressHUD'
spec.version = '1.0.0'
spec.license = { :type => 'MIT' }
spec.homepage = 'https://github.com/harikrishnant1991/JHProgressHUD'
spec.authors = { 'Harikrishnan T' => 'harikrishnant1991@yahoo.com' }
spec.summary = 'IOS HUD Swift Library'
spec.source = { :git => 'https://github.com/harikrishnant1991/JHProgressHUD.git', :tag => '1.0.0' }
spec.ios.deployment_target = '7.0'
spec.platform = :ios, '7.0'
spec.source_files = 'JHProgressHUD.swift'
end
Then I tried the following command:
pod spec lint JHProgressHUD.podspec
But I am getting the following error:
-> JHProgressHUD (1.0.0)
- ERROR | [xcodebuild] error: /Applications/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `X' in: -Xlinker
Analyzed 1 podspec.
[!] The spec did not pass validation.
What is causing this error? Since this is the first time I am trying to add a library to cocoapods, I am not sure if this is happening since this is a swift library. I have tried the library in a project and it is compiling and running fine. Can anyone guide me on how to add a library to cocoapods? I have found only a few number of tutorials and none of them was much helpful. Is it possible to add a swift library to cocoapods?