Cocoapods Dependency Manager
iOS Development Essentials
Swift
Apple's modern language — type-safe, fast, expressive.
Xcode
The IDE — code editor, simulator, debugger, profiler in one.
UIKit / SwiftUI
Old vs new UI frameworks — SwiftUI is the future.
App Store Distribution
Provisioning, signing, and the review process.
Noble Desktop's Full-Stack Web Development Certificate teaches programming fundamentals that transfer across mobile, web, and desktop development.
Master the essentials of iOS development with this tutorial, covering topics like Cocoapods Dependency Manager and installing packages, while providing a hands-on exercise in managing project dependencies.
Once Cocoapods is ready to go, we can begin installing dependencies! Create a new project called Pod Factory. We installed Firebase using the Swift Package Manager in our Jive Factory app, we are going to use Cocoapods in this bonus exercise instead.
- Click on the Pod Factory project name (not the folder) at the top of the Project navigator to open the Project Settings Editor.
- Go to File > New > File (Cmd–N).
- In the Filter text box search for Empty, scroll down to the Other section and double–click on Empty.
- Next to Save As, type: Podfile
- You should be in the Pod Factory folder, so click Create.
- In the Project navigator, make sure Podfile is selected.
It is currently blank. Type:
target "Pod Factory" do pod 'Firebase/Database' end
NOTE: Each pod consists of a library and its dependencies.
Close and save the Xcode project.
Now we need to navigate to our Podfile in the Terminal. Open Terminal (Applications > Utilities > Terminal) if it isn’t already open, then type cd followed by a single space.
NOTE: cd stands for change directory.
- There is an easy way of specifying a path in Terminal. Open a Finder window and navigate to: Desktop > Class Files > Pod Factory
- Drag the Pod Factory folder and drop it onto the Terminal window.
- Return to Terminal. You should see the path has automatically been entered.
- Hit Return. Now we are inside the Pod Factory folder.
Type the following:
pod installHit Return and wait for installation to complete. It could take several moments.
NOTE: If you encounter errors completing the pod installation, you may need to update to new pods. In your Terminal, type pod update and hit Return. Once this completes, you will need to type pod install and hit Return again.
Feel free to read more about the Firebase setup by going to firebase.Google.com/docs/iOS/setup.
Once Terminal is done installing the pod, go back to Xcode and make sure the Pod Factory project is not open.
In a Finder window, navigate into: Desktop > Class Files > Pod Factory
Notice a new file called Pod Factory.xcworkspace has been created. Open it.
NOTE: You should now work from this file instead of the Pod Factory.xcodeproj file.
In the Project navigator, notice there are two targets: Pod Factory and Pods
You have successfully installed Firebase with Cocoapods! You can now follow the same Jive Factory project steps to build a working Firebase app with Cocoapods as the dependency manager.