Install the latest and greatest version of CocoaPods before starting to work with chapters and code in this book. Executing the following command in the terminal will be enough to get you going:
sudo gem install cocoapods
To know more, visit the CocoaPods website at https://guides.cocoapods.org/using/getting-started.html.
You will be required to open the starter project and install RxSwift in the starter project at the start of each chapter. Perform the following steps in order to install RxSwift in the respective project associated to the chapter you are currently working with:
- In the chapter that you are currently working with, in the requirements section for the chapter right after the introduction, find the podfile code.
- Open Terminal and navigate to the project folder. Create a pod file inside your Xcode projects folder by executing the pod init command.
- Open the created podfile and paste the podfile code copied in the first step.
- Enter the command pod install to fetch all the listed libraries from GitHub and install all of them in the project.
- As a result of the installation, you will find a newly created workspace called .xcworkspace. Launch this file, and you are ready to work with the reactive components that will be introduced in the chapter.
Type cd /users/yourname/path/projectname to reach the podfile that you have created:
use_frameworks!
target 'YOUR_TESTING_TARGET(Name of your target)' do
pod 'RxSwift', '~> 3.6'
end
If you receive any error while trying to work with CocoaPods, for example, you can't find RxSwift, try to update the pod by typing pod update so that it fixes the indexing.