Embrace Cocoapods

Yes there are desperate times, maybe because things get worse before they get better. Anyway, please use Cocoapods in your projects.

Install CocoaPods:

1
sudo gem install cocoapods

It would not work if you are in China, try:

1
2
gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
gem sources -l

Try install CocoaPods again:

1
sudo gem install cocoapods

Up and running, next setup the Pod:

1
pod setup

Navigate to the directory containing your project:

1
2
cd someDirectory
pod init

Open the Podfile using command (or edit it using any text editor):

1
open -a Xcode Podfile

Modify Podfile (just for example):

1
2
3
4
5
6
7
platform :ios, ‘8.0’
use_frameworks!
 
target 'AlamofireSwiftyJSONSample' do
    pod 'Alamofire'
    pod 'SwiftyJSON'
end

Save it and Go back to terminal (still at your project directory):

1
pod install

From now on you have to use the .xcworkspace of your project. And before starting your work, remember to include these framework in the General, Linked Frameworks and Libraries.

You could find a better tutorial by googling.