Questions tagged [swifty-json]

SwiftyJSON is a tool to simplify handling JSON data in Swift.

SwiftyJSON is a tool to simplify handling JSON data in Swift.


Useful links


Related tags

1020 questions
8
votes
3 answers

dyld: Library not loaded: @rpath/SwiftyJSON.framework/SwiftyJSON

This is a sequel to question : dyld: Library not loaded: @rpath/SwiftyJSON.framework/SwiftyJSON After rebuilding the project from scratch (new project, new podfile, new files but in each file copy-paste the source code from the original project) the…
Glenn
  • 2,808
  • 2
  • 24
  • 30
7
votes
3 answers

swiftyJSON check if value is null

I have a json which is array of dictionary response.text = [{ "id": "4635465675", "name": "Arts", "pluralName": "Arts", "shortName": null }] json = JSON((response.text)?.data(using: .utf8)) How can i check is value for key "shortName" null or not,…
Michael
  • 123
  • 2
  • 9
7
votes
1 answer

How to keep original double value while parsing in json swift?

I received the following response from server "transactionInfo": { "currencyCode": "MYR", "total": 472.23, "roomCurrencyCode": "MYR", "roomTotal": 472.23 } but when I am trying to convert using SwiftyJson and map using below…
Shiv Jaiswal
  • 539
  • 1
  • 6
  • 22
7
votes
4 answers

SwiftyJSON & Swift 3: Cannot convert return expression of type 'Int32?' to return type > 'Int?'

We are upgrading to SwiftyJSON Swift 3 with CocoaPods config pod 'SwiftyJSON', '3.1.0'. We are getting this error: /Users/xxx/Documents/iOS/xxx/Pods/SwiftyJSON/Source/SwiftyJSON.swift:866:33: Cannot convert return expression of type 'Int32?'…
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
7
votes
5 answers

SwiftyJSON supported in Xcode 8 and iOS 10?

I recently upgraded my Swift iOS application from Xcode7 to Xcode8 and deployment platform from iOS 9.3 to iOS 10. My application started breaking with errors like this: Module file was created by an older version of the compiler: rebuild …
Nital
  • 5,784
  • 26
  • 103
  • 195
7
votes
7 answers

How to create the model class for the following JSON data and parse it?

My JSON data { "addon_items" : [ { "aname" : "", "id" : "2588", "name" : "Plain Nan", "order" : "1", "aid" : "259", …
PRADIP KUMAR
  • 489
  • 1
  • 9
  • 31
7
votes
3 answers

Dynamically Generate UITableView Cells and Headrs

Project files: https://jumpshare.com/v/Otai3BBXYwfvyz8jb53k (Would be wise to view these to see structure of project) Problem: Ok, so i'm following a tutorial that creates a UITableView with headers and then cell content. The code worked and runs…
MarkP
  • 2,546
  • 5
  • 31
  • 48
7
votes
4 answers

Converting JSON from AlamoFire/SwiftyJSON to Dictionary in Swift/Xcode

My head is going to explode :) - I've been trying to get a JSON String from my server to a Dictionary Value, and I can't get it to work. I'm trying to get (from my Server - this is dynamic and I want my app to be able to pull new data from the…
davidbii
  • 105
  • 1
  • 1
  • 5
7
votes
2 answers

NSDictionary to json string to json object using SwiftyJSON

I have a use case where I have an array of dictionaries and I need them as a json object: var data = [Dictionary]() //append items var bytes = NSJSONSerialization.dataWithJSONObject(data, options: NSJSONWritingOptions.allZeros,…
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601
6
votes
4 answers

Post array of objects with Alamofire and SwiftyJSON

I have an array of dictionaries that I am trying to post to Alamofire with the help of SwiftyJSON. The api is set to take: [ { "imageUrl": "someimage3.jpg" }, { "imageUrl": "someimage4.jpg" } ] My array with image…
Keith
  • 1,969
  • 4
  • 17
  • 27
6
votes
1 answer

How to write Unit Test for Alamofire request function?

I have a project where I'm sending .GET requests to get data from the server and for this I'm using Alamofire & SwiftyJSON. For example: I have file "Links", "Requests" and my ViewController. Links.swift var getAllData: String { return…
Doe
  • 431
  • 1
  • 8
  • 16
6
votes
4 answers

Alamofire + SwiftyJSON Compile Error after converting to Xcode 7

This line has always been working fine for me for making Alamofire Requests and getting the JSON response. Alamofire.request(req).responseJSON() { (request, response, data, error) in // .... } After upgrading to XCode 7 and converting…
Lavvo
  • 1,024
  • 3
  • 16
  • 35
6
votes
2 answers

dyld: Library not loaded: @rpath/SwiftyJSON.framework/SwiftyJSON

I've been using the simulator to test my app. Today I decided to test it using other devices in the simulator and to my surprise it crashes on startup on some devices, on others it works perfectly My app builds an runs on : iPad Air resizable…
Glenn
  • 2,808
  • 2
  • 24
  • 30
6
votes
5 answers

How to combine two SwiftyJSON objects

I have a swiftyJSON object that looks like for example: [{ "location" : "http://...", "img" : "http://...", "commentCount" : 0, "timestamp" : 1432460217550, }] I want to be able to append another swiftyJSON object to it so that it looks…
Tometoyou
  • 7,792
  • 12
  • 62
  • 108
6
votes
1 answer

Swift Alamofire SwiftyJSON Asynchronous/Synchronous Class Methods

So I currently have the following: class ViewController: UIViewController { class Identity{ let baseUrl = "superSecretURL" var _username: String = "" var _password: String = "" var _apiKey: String = "" init(){ } …
Alex Bailey
  • 1,260
  • 12
  • 27
1 2
3
67 68