Hi!
Cocoapods is a dependancy manager of cocoa projects for Swift and Objective-C. It contain lots of projects and library to reduce your work. cocoapods comfortable for IOS, OS X, WatchOS and tvOS.
Configuration:
on MAC system install on the latest one is good.
OS X : OS X 10.11 or grater is good to install cocoapods.
XCODE : XCODE version 7.3 or grater is good.
IOS : IOS 9.3 or grater.
Process To Install:
1) Open TERMINAL ((cmd+space) type terminal)
2) $ sudo gem install cocoapods (Install cocoapods)
Notes : if your are using OSX EI Caption please fallow the below
2) $ sudo gem install -n /usr/local/bin cocoapods
3) $ ******** (you have to enter your system password when ask by terminal)
4) $ pod setup (setup the pod)
Notes : it will take some time to download and setup please be patient
Thats all about install
How to use COCOAPODS
1) create a new project on XCODE
2) Exit from Xcode
3) Open Terminal
4) Direct and open the folder on the project
xxxxx:~ iosdcs$ cd folder/which/contain/project
5) $ pod init (it will initiate the pod on the project)
7) Save and quit the xcode
8) $ pod install (to install the pod file on the project)
it will create a pod file on your project folder
9) Go to your project directory and open the "your_project_name.xcworkspace"
Notes : don't open "your_project_name.xcodeproj"
Notes :
If it makes any problems like file not found and etc.., please fallow as shown on this image for setup.
Enjoy The Coding!
Sample Code :
Thank You!
Have A Great Day..,
Cocoapods is a dependancy manager of cocoa projects for Swift and Objective-C. It contain lots of projects and library to reduce your work. cocoapods comfortable for IOS, OS X, WatchOS and tvOS.
Configuration:
on MAC system install on the latest one is good.
OS X : OS X 10.11 or grater is good to install cocoapods.
XCODE : XCODE version 7.3 or grater is good.
IOS : IOS 9.3 or grater.
Process To Install:
1) Open TERMINAL ((cmd+space) type terminal)
2) $ sudo gem install cocoapods (Install cocoapods)
Notes : if your are using OSX EI Caption please fallow the below
2) $ sudo gem install -n /usr/local/bin cocoapods
3) $ ******** (you have to enter your system password when ask by terminal)
4) $ pod setup (setup the pod)
Notes : it will take some time to download and setup please be patient
Thats all about install
How to use COCOAPODS
1) create a new project on XCODE
2) Exit from Xcode
3) Open Terminal
4) Direct and open the folder on the project
xxxxx:~ iosdcs$ cd folder/which/contain/project
5) $ pod init (it will initiate the pod on the project)
6) $ open -a Xcode podfile (to open the pod file on xcode to make changes)
Notes : you can edit your pod file based on your requirement to call the library
eg:
# Uncomment this line to define a global platform for your project platform :ios, '9.0'
target 'Jesus' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'Alamofire', '~> 3.0'
# Pods for Jesus
target 'JesusTests' do
inherit! :search_paths
pod 'Alamofire', '~> 3.0'
# Pods for testing
end
target 'JesusUITests' do
inherit! :search_paths
# Pods for testing
end
end
7) Save and quit the xcode
8) $ pod install (to install the pod file on the project)
it will create a pod file on your project folder
9) Go to your project directory and open the "your_project_name.xcworkspace"
Notes : don't open "your_project_name.xcodeproj"
Notes :
If it makes any problems like file not found and etc.., please fallow as shown on this image for setup.
Enjoy The Coding!
Sample Code :
import UIKit
import Alamofire
// Import your library
override func viewDidLoad() {
super.viewDidLoad()
Alamofire.request(.GET, url_maj).responseJSON { response in
if let JSON = response.result.value {
let jsonObj = JSON as? NSDictionary
let data_ = jsonObj!["data"] as! NSArray
for item in data_ {
let MS04Key = item["MS04Key"]!
let MajorName = item["MajorName"]!
print("MS04Key is \(MS04Key!)")
print("MajorName is \(MajorName!)")
}
}
}
}
for POST
for POST
Alamofire.request(.POST, "http://xxxxx/xxxxx/xxxxx/get", parameters: ["xxType": "dradr","xxName": "Test Attaching","xxxcusName": "THE LIGHT","fxxolderName": "xout00001t","xxsubmitterName": "METEST"]).responseJSON { response in
if let JSON = response.result.value {
// Your Logic
}
Have A Great Day..,
