Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Seeding your library with CocoaPods

Seeding your library with CocoaPods

Talk given at CocoaHeads Strasbourg.

Frédéric Maquin

November 26, 2015
Tweet

More Decks by Frédéric Maquin

Other Decks in Programming

Transcript

  1. SEEDING YOUR LIBRARY WITH
    CocoaHeads Strasbourg Frédéric Maquin
    @ephread
    November 26th, 2015

    View Slide

  2. COCOAPODS?

    View Slide

  3. View Slide

  4. Centralised dependency manager for
    Xcode projects.

    View Slide

  5. AUGUST
    2011
    ELOY DURÁN
    @ALLOY

    View Slide

  6. AUGUST
    2011
    ELOY DURÁN
    @ALLOY

    View Slide

  7. RUBYGEM-LIKE

    View Slide

  8. GITHUB-BASED

    View Slide

  9. View Slide

  10. $ [sudo] gem install cocoapods
    Installation

    View Slide

  11. PODFILE
    VS.
    PODSPEC

    View Slide

  12. Podfile
    source 'https://github.com/CocoaPods/Specs.git'
    platform :ios, '8.0'
    use_frameworks!
    pod 'ElsassPod', '~> 1.0'

    View Slide

  13. Podfile
    $ pod install

    View Slide

  14. *.podspec
    Pod::Spec.new do |s|
    s.name = "ElsassPod"
    s.version = "1.0.0"
    s.summary = "Made in Elsass"
    s.homepage = "https://github.com/ephread/ElsassPod"
    s.license = "MIT"
    s.author = { "Frédéric Maquin" => "[email protected]" }
    s.source = { :git => "https://github.com/ephread/ElsassPod.git",
    :tag => s.version.to_s }
    s.platform = :ios, "8.0"
    s.requires_arc = true
    s.source_files = "ElsassPod", "Source/*.swift"
    s.resources = ["Source/*.xcassets"]
    end

    View Slide

  15. MANAGING LIBRAIRIES

    View Slide

  16. Automatic Integration
    $ pod lib create
    CocoaPods is opinionated!

    View Slide

  17. Automatic Integration
    $ pod lib create
    CocoaPods is opinionated!

    View Slide

  18. Manual Integration
    Write the .podspec file by hand.

    View Slide

  19. $ pod spec lint mypod.posdspec
    $ pod lib lint mypod.posdspec
    REMOTE
    LOCAL
    Linting

    View Slide

  20. Linting
    Always lint your pod locally first!

    View Slide

  21. Public pods
    $ pod trunk push ElsassPod.podspec

    View Slide

  22. Private pods
    $ pod repo add REPO_NAME SOURCE_URL
    $ pod repo push REPO_NAME ElsassPod.podspec

    View Slide

  23. Private pods
    source 'https://github.com/ephread/ElsassPodSpecs.git'

    View Slide

  24. DEMO

    View Slide

  25. QUESTIONS?

    View Slide