Making a CocoaPod from an existing Xcode project

前端 未结 2 514
眼角桃花
眼角桃花 2021-01-01 13:12

I\'ve been trying to crack this with no avail so far. I have my Xcode Swift project with its github repository for source control. I would like to create a new CocoaPod with

2条回答
  •  遥遥无期
    2021-01-01 13:49

    Taken from the Cocoapods documentation:

    $ pod spec create YourProject
    $ edit YourProject.podspec
    

    Then in editor replace s.source_files = "Classes", "Classes/**/*.{h,m}" with

    s.source_files = "Classes/**/*.{swift}"
    

    Then run until you pass all tests..

    $ pod spec lint YourProject.podspec
    

    Thats basically all.

    You can test this Podspec in real life by creating a new demo app and follow the 9 steps from Anbu.Karthik.

    In the created podfile add something like:

    pod 'YourProject', :path => '/Users/you/work/YourProject'
    

    The path should point to the dir containing the podspec file. Run pod install again.

提交回复
热议问题