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

CocoaPods intro

1a8210be06c7e4e4add04eb95ea7964c?s=47 Marin Usalj
September 04, 2014

CocoaPods intro

A beginner - level talk on CocoaPods for NSMeetup 09/2014

1a8210be06c7e4e4add04eb95ea7964c?s=128

Marin Usalj

September 04, 2014
Tweet

More Decks by Marin Usalj

Other Decks in Programming

Transcript

  1. None
  2. Marin Usalj supermar.in

  3. None
  4. iOS @ Yammer

  5. None
  6. D3p3nd3ncy M4n4g3m3n7 CocoaPods Showtime

  7. D3p3nd3ncy M4n4g3m3n7

  8. I can do this myself

  9. Your computer does it better and faster

  10. More work for 1 developer, less work for 19238421 users

  11. D3p3nd3ncy M4n4g3m3n7 resolution fetching integration discoverability

  12. resolution AFNetworking -> Rechability (> 2.0.0) ShareKit -> Rechability (3.1.0)

  13. resolution AFNetworking -> Rechability (> 2.0.0) ShareKit -> Rechability (3.1.0)

    SocketRocket -> Reachability (2.0.0)
  14. duplicate symbols

  15. Fetching [=========> ] 25%

  16. Fetching [===================> ] 50%

  17. Fetching [=============================> ] 75%

  18. Fetching [======================================> ] 99%

  19. Integration Let's integrate a complex dependency

  20. None
  21. VS

  22. None
  23. CocoaPods

  24. Ecosystem

  25. Discovery machine

  26. None
  27. None
  28. Deals with deps and code sync

  29. Resolves dependencies

  30. Resolves dependencies Downloads dependencies

  31. Resolves dependencies Downloads dependencies Integrates dependencies

  32. Resolves dependencies Downloads dependencies Integrates dependencies Synchronizes dependencies

  33. Bonus

  34. Removes deps easy and fast

  35. Core Team

  36. Eloy Durán @alloy

  37. Fabio Pelosin @irrationalfab

  38. Orta Therox @orta

  39. Keith Smiley (machine) @Keithbsmiley

  40. None
  41. None
  42. Hanging out on Slack (Thanks Slack!)

  43. None
  44. Showtime

  45. Using pods

  46. Podfile pod 'AFNetworking' pod 'Kiwi', :head

  47. Podfile pod 'AFNetworking' pod 'Kiwi', :head pod 'SSKeychain', '~> 2.1.2'

  48. Podfile pod 'AFNetworking' pod 'Kiwi', :head pod 'SSKeychain', '~> 2.1.2'

    pod 'SSKeychain', '~> 2.1.3' # .... pod 'SSKeychain', '~> 2.1.999'
  49. $ pod install

  50. $ pod install def install! resolve_dependencies download_dependencies generate_pods_project integrate_user_project if

    config.integrate_targets? perform_post_install_actions end
  51. NSMeetup.xcodeproj

  52. NSMeetup.xcodeproj NSMeetup.xcworkspace

  53. None
  54. Where did pods come from?

  55. None
  56. Where did Specs come from?

  57. None
  58. Hosted on Github

  59. On your computer ~/.cocoapods/repos/master

  60. Private pods / specs

  61. Private pods / specs ~/.cocoapods/repos/master ~/.cocoapods/repos/Yammer

  62. Your internal libraries

  63. Private shared code between apps

  64. pod command

  65. $ pod Commands: + help Show help for the given

    command. + init Generate a Podfile for the current directory. + install Install project dependencies + lib Develop pods + list List pods + outdated Show outdated project dependencies + plugins Show available CocoaPods plugins + repo Manage spec-repositories + search Searches for pods + spec Manage pod specs + trunk Interact with the CocoaPods API (e.g. publishing new specs) + try Try a Pod! + update Update outdated project dependencies
  66. Don't be afraid :) Try out plugins Try out pods

  67. Creating your pod

  68. pod lib create To create

  69. . ├── Example │ ├── AwesomeLib │ ├── AwesomeLib.xcodeproj │

    ├── AwesomeLib.xcworkspace │ ├── Pods │ └── Tests └── Pod ├── Assets └── Classes 9 directories
  70. pod lib lint When ready to publish

  71. pod trunk push Shipit!

  72. None
  73. Trunk Robot version of Keith. Lives in Herokuland

  74. Installing [sudo] gem install cocoapods

  75. Never do sudo pod install

  76. Contributing <3

  77. Bunch of Ruby Ask for help!

  78. Clone Rainforest github.com/cocoapods/rainforest

  79. Swift? Bridging header

  80. Thanks Steve Derico, CocoaPods team, Yammer

  81. QA @supermarin supermar.in