I followed the instruction from Cocoapods.
Below is my Podfile:
platform :ios, \'8.2\' pod \'SwiftyJSON\', \'~> 2.1\' pod \'SwiftSpinner\', \'~&
I my case i used to upgrade cocoapods by command sudo gem install cocoapods and my issue got resolved. I used objective - c as well as swift libraries in my project.
sudo gem install cocoapods