Ceate one new class give that name is like this and copy that code in side that file import UIKit class APIConnection: NSObject,URLSessionDelegate { class var sharedInstance: APIConnection { struct Static { static var onceToken: Int = 0 static var instance = APIConnection() } return Static.instance } func PostResponseFrom(strUrl:String ,Parameter:NSMutableDictionary, completionHandler:@escaping (_ result:Any, _ status:Bool, _ statusCode:CLong)->Void ) -> () { let configuration = URLSessionConfiguration.default let session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main) let postUrl = U...