Cocoapods
Install Cocoapods
- Run in terminal:
sudo gem install cocoapods
- After installation, there will be a lot of messages, read them and if no error found, it means cocoapods installation is done. Next, you need to setup the cocoapods master repo. Type in terminal:
pod setup
It will download the master repo. The size is very big. It can take a while.
Once it output "Setup Complete", you can create your Xcode project.
In terminal, cs to "your Xcode project root directory" (where your .xcodeproj file resides) and run:
pod init
- Create a Podfile and open it in Xcode:
open -a Xcode Podfile
- Your Podfile will get open in test mode. Initially there will be some default commands. Here is where you add your project's dependencier. For example, in Podfile, type:
use_frameworks!
target 'Your App Name' do
pod 'Socket.IO-Client-Swift', '~> 8.1.0' # Or latest version
end
- Run in terminal:
pod install
Now you can use this third party lilbrary - SocketIO. Close xcodeproj and open xcworkspace. Start coding