Posts

Showing posts from May, 2018

How to Call API using AFNetwork in Swift

 Install Pod file on your Project open this link for install pod file : install pod in mac Write this code on your Project and Used it.  import UIKit class AppHandler: NSObject { class var sharedInstance: AppHandler { struct Static { static var onceToken: Int = 0 static var instance = AppHandler() } return Static.instance } let manager = AFHTTPRequestOperationManager(); func checkForNewUpdates(){ let parameters = NSMutableDictionary(); parameters.setObject("1", forKey: "U_ID" as NSCopying); AppHandler.sharedInstance.manager.post( "Your URL Type HERE", parameters: parameters, success: { (operation,responseObject) in Z.log("JSON: " + (responseObject as AnyObject).description) if let errorResponse = (responseObject as AnyObject).value(forKeyPath: &quo

how to Install Pod File in MAC

Close your project. open terminal on you MAC. Write this line : CD "Copy Your Project URL and PAST Here." Enter it    Write this line $ sudo gem install cocoapods   Then write a password on your MAC. Then : $ pod init    OPEN pod file and write you want to be install a pod, in our case we will install AFNetwork platform :ios , ' 8.0 ' target ' TargetName and your project name' do pod ' AFNetworking ' , ' ~> 3.0 ' end   version of your pod is optional.  Then install it : pod install   Then open file : App.xcworkspace    I Hop you Enjoy this tutorial keep touch in this blog for more update