More than ever before, developers are faced with the challenges of managing their reliance on third-party libraries to improve productivity and build cutting-edge apps. This course is an exploration in project dependency management for apps that are developed for Apple platforms using a popular dependency manager called CocoaPods.
CocoaPods is one of the most popular and well-established dependency managers for apps that are developed for OS X, iOS, and even watchOS and tvOS! This course will guide you through the core concepts of dependency management. You will learn how to use CocoaPods to organize third-party libraries and improve your productivity. The course also covers the process of creating CocoaPod libraries and how to share your innovation with the world. Finally, you will see how CocoaPods can enable you to share code with your development team by hosting a private repository, accessible only by your organization.
Andrew Bancroft is a born learner, passionate about discovery and about sharing what he’s learned with others. He has embraced Swift for iOS development since day zero, and loves empowering developers to succeed at building iOS apps with Swift.
Creating CocoaPod Libraries The team has come a long way since I first transplanted you into their world at the beginning of the course. CocoaPods has turned out to be a vast improvement over their previous attempts at managing dependencies manually. So much so that enthusiastic discussions about how they might begin to create their own CocoaPods libraries have been circling the office. In this module I will guide you and our model team through the process of creating and preparing to deploy your own libraries out to the CocoaPods central repository, or the Trunk as they call it. This will let others begin to benefit from your innovation.
Hosting a Private CocoaPods Repository CocoaPods has made a tremendous difference in our model team's ability to manage their dependencies on third party libraries. If you're just now joining us for this fourth and final module, welcome. You as the learner are still embedded in this model team of iOS developers that I just alluded to. They're also still working on the Expresso app, which is a mobile ordering system for a local coffee shop. With the completion of the last module in this course, the team is now empowered to create their own CocoaPods libraries, and submit them to the public CocoaPod spec repository known as the Trunk. But you know, that got them thinking, while sharing their work with the world has its place, an even more practical use case is to create CocoaPods and deploy them to a private repository. The team views this as an attractive option for sharing code internal to their business between all of their projects. That'll be the focus of this module. I will teach you how to set up a private spec repository, and how to configure CocoaPods to use it. We're going to get right to it in this module. Some of the sections will move quickly, and I won't take time to explain every detail of the things I've already taught previously in the course. That being the case, here are a few of the things I would call prerequisites to moving forward with this module. You should be familiar with how our CocoaPod library project is scaffolded at using the command line utility because I'm going to start with one already created. It would also be good if you understood the sections of a scaffolded CocoaPods library project. Knowing how to host a CocoaPod library source code on GitHub or something similar is also something I'm assuming you're able to do. Finally you should understand what a Podspec file is, and what the various pieces of its metadata are. You should also be able to validate one using the CocoaPods command line utility. All of these topics and more are covered in detail in Module 3, so if you need to jump back to familiarize yourself with any or all of these topics, feel free to do that before moving forward. First up on our agenda is setting up a private spec repository. Watch as the team does that now.