alamofire

Error: Importing Alamofire

半腔热情 提交于 2020-01-15 12:44:01
问题 ..Hi I'm having a hard time Importing Alamofire I've finished the tutorial but I got an error message in "import Alamofire" line 2.. what should I do??..In buid phases my Target Dependencies was "Alamofire iOS (Alamofire)" that was my only option together with the "Alamofire OSX (Alamofire)" no option for "Alamofire (Alamofire)" like in the tutorial.. import UIKit import Alamofire class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() Alamofire.request(.GET

Error: Importing Alamofire

陌路散爱 提交于 2020-01-15 12:42:45
问题 ..Hi I'm having a hard time Importing Alamofire I've finished the tutorial but I got an error message in "import Alamofire" line 2.. what should I do??..In buid phases my Target Dependencies was "Alamofire iOS (Alamofire)" that was my only option together with the "Alamofire OSX (Alamofire)" no option for "Alamofire (Alamofire)" like in the tutorial.. import UIKit import Alamofire class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() Alamofire.request(.GET

How to append array in multipart form data with Alamofire?

三世轮回 提交于 2020-01-15 09:33:10
问题 I am uploading image with multipart form data using Alamofire but getting some problem while i am passing an array as parameter. As per request i need to pass all data into letter. Here is how i am doing. let data = try! JSONSerialization.data(withJSONObject: arrSelectedRecipientsID, options: .prettyPrinted) let jsonString = String(data: data, encoding: .utf8)! let paramArr : [String : Any] = [ "message" : txtvwMessage.text!, "status": "draft", "recipient_ids": jsonString ] let parameter :

Alamofire nonblocking connection

别等时光非礼了梦想. 提交于 2020-01-14 05:24:27
问题 I am using Alamofire for basic networking. Here is my problem. I have a class class User { var name:String? var company:String init () { // manager = Alamofire.Manager(configuration: configuration) } func details () { //first we login, if login is successful we fetch the result manager.customPostWithHeaders(customURL!, data: parameter, headers: header) .responseJSON { (req, res, json, error) in if(error != nil) { NSLog("Error: \(error)") } else { NSLog("Success: \(self.customURL)") var json =

Swift/PHP How to display mysql data (json) in UITableView using Alamofire

不问归期 提交于 2020-01-13 20:21:13
问题 I would like to create a TableView which return just one cell. Include in this cell three labels: id, username and category. This would result to let user to see his basic detail info. When I Run the APP, my UITableView still not showing any result (blank). Please anyone can review my code to make it works ? I can not see where I am wrong as I don't get any error in Xcode TableView Controller import UIKit import Alamofire class MyProfile: UITableViewController { var users =

Swift 3- Update UI from main thread

淺唱寂寞╮ 提交于 2020-01-13 05:14:43
问题 I wanted to load data in background thread and update tableview/UI on main thread. Based on what's indicated here about threading, I was wondering if the code below is the way to go about it. I'm trying to load more data as user scrolls to a specific index and wanted to make sure the UI is not freezing due to threading. Thank you! func loadMore () { guard !self.reachedEndOfItems else { return } self.offset = self.offset! + 10 print("load more offset: \(self.offset)") var start = 0 var end = 0

A solution to track a batch of HTTP requests in swift 3.0

百般思念 提交于 2020-01-11 13:19:07
问题 I am using swift 3.0 running under iOS 10.0 and I want to craft some code that fires when a batch condition is met. for i in 0 ..< rex { async code, disappears and does it stuff } Imagine the async code is a collection of URL requests, that basically background as soon as I loop thru them. Now how can I fire off more code when "rex" requests have completed? I thought of setting up a timer to watch and check every second, but its surely not a good solution. I thought kicking off another thread

What's the best way to make a HTTP post with custom JSON BODY

时光怂恿深爱的人放手 提交于 2020-01-11 13:05:58
问题 I'm struggling :( to make an HTTP post request with a custom JSON Body, I have tried Alamofire with the code : let list = [[Time: 30, IdQuestion: 6510, idProposition: 10], [Time: 30, IdQuestion: 8284, idProposition: 10]] let json = ["List":list,"IdQuiz":"102","IdUser":"iOSclient","UserInformation":"iOSClient"] let data = NSJSONSerialization.dataWithJSONObject(json, options: NSJSONWritingOptions.PrettyPrinted,error:nil) let jsons = NSString(data: data!, encoding: NSUTF8StringEncoding)

Alamofire 5: Value of type 'Result<Data, AFError>' has no member 'value'

徘徊边缘 提交于 2020-01-11 06:20:28
问题 Is the a new error in Alamofire 5? as this wasn't running into bugs last time. Below are the code which are done. Anyone who used Alamofire facing this? import Foundation import Alamofire class MyAppService { static let shared = MyAppService() let url = "http://127.0.0.1:5000" private init() { } func getCurrentUser(_ completion: @escaping (SomeRequest?) -> ()) { let path = "/somePath" AF.request("\(url)\(path)").responseData { response in if let data = response.result.value { //error shown

How to implement self signed certificates in Alamofire?

不问归期 提交于 2020-01-10 20:06:15
问题 I write a swift based app with a self signed certificate server communication. As a network library I want to use Alamofire. However Alamofire doesn't support self signed certificates. Is it possible to implement this feature easily and how? 回答1: This feature is not yet supported by Alamofire. It will most likely be added eventually by the community, but that work has yet to be submitted to the project. If you feel like contributing this feature, by all means fork the repo and submit a pull