1. Install brew as below link
http://brew.sh
2. Install Carthage
brew install Carthage
brew update
3. Go to your xcode project create "Cartifile" file and type
github "robbiehanson/CocoaAsyncSocket" "master"
(base on your library)

4. In Terminal, type
cd ~/your xcode project/
Carthage update --platform iOS
5. Done
Reference
- https://github.com/Carthage/Carthage/
- https://github.com/robbiehanson/CocoaAsyncSocket