Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
70 views

Issue Overcoming Missing Values in API App

I was playing with a Swift app someone made on Youtube that accesses the Google Books API and returns the results of a (hard-coded) query. While playing with it, I noticed it kept crashing. Playing ...
AzAzinZ's user avatar
  • 21
0 votes
1 answer
205 views

Unable to parse Json properly with SwiftyJson

I have the folllowing Json response: ` [Body]: {"id":"cmpl-6Z45N6vfd2312vdfqyYPb8aDRVe9Nft7vfnpoEsL","object":"text_completion","created":...
Mansidak's user avatar
  • 146
-1 votes
1 answer
333 views

No Such Module Moya

I am Using xcode 13.4.1 and installing pod 'SwiftyJSON', '~> 4.0' pod 'Moya', '~> 15.0' these pods successfully i can't import these pods in my class.
Modassir's user avatar
1 vote
1 answer
35 views

Using Swifter to pull a twitter list will only pull tweets with media links and not ones with full text based on my case let statement in SwiftUI

I am currently building an app to display tweets from a twitter list. For some reason I am only appending tweets with media links, and skipping over tweets with just full text and no media. The JSON ...
eazey12's user avatar
  • 11
0 votes
1 answer
139 views

Undefined Symbol: SwiftyJSON - Unit Testing

I've been looking at how to fix this bug extensively without success. Currently, I'm using Xcode 14. I don't know if this has something to do with these errors. Basically, they appear when I try to ...
Brogrammer's user avatar
1 vote
1 answer
62 views

Invalid type in JSON write (.SurveyAnswer) - SwiftyJSON

Something must be wrong in my model because my project fails with this error whenever this function runs. func communityGroupPost(postUtil: PostShareUtil, success: @escaping (ResultModel<BaseModel&...
Mert Köksal's user avatar
1 vote
0 answers
55 views

Load Various Custom Views inside 'some View '

I've been working on a SwiftUI project that generates UIs based on Server responses using JSON In order to do that I have created a FormBuilder Now I want to show various types of custom fields like ...
Naleesh Jeffrey's user avatar
0 votes
3 answers
3k views

Swift 5 : Create JSON with Codable / Struct from my variables

I would like to create a Codable structure to save data from a user profile. Let's say the iOS user filled a form with his name, last name, address, put his picture (UIImage) and that user have a ...
Victor's user avatar
  • 81
0 votes
1 answer
933 views

Alamofire 5 - DataRequest with SwiftyJSON as response

Before you tell me to use Decodable for all the models, and you would be right, I am trying to fix a project in the time the client has allocated. Changing all models to Decodable, and all the places ...
skymook's user avatar
  • 3,581
0 votes
1 answer
115 views

How do i populate three sections in a tableview with SwiftyJSON

I want to assign records or cells for 3 sections ["Managers","Accountants","Receptionist"] where key "authority" has the validation of which section it belongs ...
Ramy Khaled's user avatar
0 votes
0 answers
961 views

Swift fix Cannot assign value of type '()?' to type '[ShopData]?'

im stuck resolving my problem for over a week and i dont know how, im junior. i want to get an array data from the dictionary data which both has the same name in backend = "data", "...
Bran's user avatar
  • 11
0 votes
1 answer
81 views

how to populate cells in a UItableview with switfyJson from an alamofire post request

I have a Tableviewcontroller embedded in a Viewcontroller. And i would like to populate this 3 cells with data from my alamofire post request. whats the easiest way to get that done? i can see my ...
Didi Mike's user avatar
0 votes
0 answers
43 views

remove extra objects from string or array while hitting api

I wanna pass whole array to api which expects string. My "education" expects any string like "education" : "ncert" but I wanna pass multiple elements to it. So to pass ...
Mel's user avatar
  • 469
0 votes
0 answers
55 views

Parse and mapping data in tableview with Alamofire and SwifrtJSON with completion handler(@escaping)

I have data models. I make a request and get JSON. But I want to use the completion handler to add data to the table. How do I save data and display it in a tableview? I didn't use the entire data ...
Pavel Zaruckov's user avatar
0 votes
0 answers
430 views

How do I create a Package.swift file for a package in Xcode's package manager?

I'm trying to use SwiftyJSON within an Xcode project via the built in package manager. The first time I try to add it through Xcode, The app complains about missing Swift-tools version specification ...
Soulfire J. Backblaze's user avatar
-2 votes
1 answer
183 views

SwiftyJSON data is only using the first element of my json

I'm using Alamofire and SwiftyJSON and I'm getting my data, but my view is only repeating the data for the first element of the JSON. The data should be Monday, Tuesday, Wednesday, and so on [![enter ...
Robert's user avatar
  • 1,150
0 votes
1 answer
136 views

Get multiple strings from JSON

So the JSON variable let json = JSON(nearbyChargingSites.jsonString!) contains the current data.: { "timestamp" : 1626902257093, "superchargers" : [ { "location&...
Erik Auranaune's user avatar
1 vote
0 answers
23 views

why i cant get the json from this scrip in php using alamofire?

i wrote this script to sign in the user in PHP in order to save the data to the server, if the user has been created the scrip should return a simple json with true or false. <?php require ".....
Damiano Miazzi's user avatar
0 votes
0 answers
42 views

understand why fail to return the json from a php script when using respondJSON in alamofire

I wrote the following script in PHP in order to signup the user in a MySQL table. <?php $host = "127.0.0.1"; $user = "root"; $password = ""; $database = "...
Damiano Miazzi's user avatar
0 votes
1 answer
318 views

No such module 'Alamofire' - Xcode 12

I'm trying to import Alamofire to a Swift 5 Xcode project (Xcode 12, iOS 14.4) but I'm getting the 'No such module'Alamofire'' error message. The Cocoapods for the latest Alamofire and SwiftyJSON ...
Chris's user avatar
  • 21
0 votes
1 answer
395 views

Use SwiftyJSON to convert tuple array to JSON string

I wanted to convert a simple array of tuples like this to a JSON string using SwiftyJSON: let tupleArray: [(Int, Int)] = [(1,1), (2,2), (3,3)] let tupleArrayAsJsonSttring = JSON(tupleArray)....
Jay Jay's user avatar
  • 167
-1 votes
2 answers
210 views

How to convert array to dictionary with SwiftyJSON?

I restructured my endpoint return and want my front end code to work with the old way. I have 3 values in an array and would like to convert it to a dictionary [Int64: JSON]. I'm using SwiftyJSON. ...
14079_Z's user avatar
  • 447
0 votes
1 answer
740 views

Successfully write JSON to Realm DB using swiftyJSON in Swift

I am trying to write to a Realm DB from JSON file (using swiftyJSON) get the following error: libc++abi.dylib: terminating with uncaught exception of type NSException *** Terminating app due to ...
ecjps82's user avatar
  • 13
-1 votes
1 answer
518 views

value becomes null after function swift

I've been practicing swift in a couple of days now, just stuck with this problem when after calling a function getItunesData() the model var songItems: [SongItem] = [] becomes nil. I've tried ...
Xavier Johanis's user avatar
1 vote
1 answer
562 views

Cannot assign value of type '[JSON]' to type '[MyStruct]'

I'm learning to use SwiftyJSON and I'm trying to convert the resulted values into an array of MyStruct. However, whenever I try that, it tells me that they are not compatible. How can I convert [JSON] ...
Nico Cobelo's user avatar
0 votes
1 answer
41 views

Having trouble appending value from JSON Parsing to array in Swift

I'm playing around with https://jsonplaceholder.typicode.com and I'm trying to create a list of the albums. I tried following the example here, but the list of album titles isn't showing up on the ...
Nico Cobelo's user avatar
1 vote
1 answer
78 views

responseJSON json parse in Alamofire

I am getting json form server. But json parsing nil in swift. Here is my json { "out_code":"0", "out_message":"0", } I tried bellow code to out_code ...
Enamul Haque's user avatar
  • 5,007
0 votes
1 answer
731 views

Update JSON Array in Swift 5

I have a JSON array fetching from url and convert using SwiftyJSON. Now i want to update some value of JSON Array for some functionality. My JSON is like [ { "id" : 48845152, ...
M Mahmud Hasan's user avatar
0 votes
1 answer
202 views

Parse JSON response with SwiftyJSON

I have the following code and I am trying to get values using SwiftyJSON: let string = """ {"ResponseMetadata": {"RequestId": "b5d6ecad-e050-4d1f-...
Asteroid's user avatar
  • 1,098
0 votes
2 answers
969 views

How can I convert a JSON as Data Type in Swift?

I want to send data to my websocket server in swift but the websocket server write function only accepts strings or the data type. Since I did not find any JSON.stringify option for swift I used ...
Lucas Goldner's user avatar
-3 votes
1 answer
58 views

Parse Alamofire result swift

I'm very lost parsing the following response from an AF request – let json = result as! NSDictionary – in Swift: { errors = ( ); get = statistics; parameters = { ...
j___.___j's user avatar
  • 326
0 votes
1 answer
62 views

How create a usable data object

I have swiftyJSON added as a package dependancy and have the appropriate import statement. My JSON file has the following format: "00AK": { "icao": "00AK", ...
mistuk's user avatar
  • 1
0 votes
0 answers
169 views

`keyNotFound` error when creating object from Gmail API Response with Swift on iOS

I'm using Alamofire to get emails from the Gmail API via the message IDs: AF.request("https://www.googleapis.com/gmail/v1/users/me/messages/\(id)?format=full", headers: headers) ...
narner's user avatar
  • 3,161
1 vote
1 answer
437 views

Fatal error: Can't compare indices belonging to different collections:

I'm getting a strange error when iterating over the contents of a SwiftyJSON object. I initialise the object and pass to a function which converts the JSON to a dictionary suitable for a POST request ...
Derek's user avatar
  • 2,112
0 votes
3 answers
592 views

framework not found SwiftyJSON

I'm getting that "framework not found SwiftyJSON" error after pod update. I have tried many clean build folder and project. But It still stays in there. What should I do? my pod file ...
cacameca's user avatar
0 votes
1 answer
103 views

SwiftyJSON convert string array to array not working

I have data as below: data = [ "\u65b0\u5317\u5e02\u4e09\u91cd\u5340","\u65b0\u5317\u5e02\u6c38\u548c\u5340", "\u53f0\u5317\u5e02\u4e2d\u5c71\u5340","\u53f0\u5317\...
Berlin's user avatar
  • 65
-1 votes
1 answer
58 views

Loop JSON requests to backend (REST API)

I am sending request to the backend (REST API). My task: If the JSON response does not come in the required format, or returns an error, then start the request cycle - 3 attempts, and if these three ...
Oleg Savelyev's user avatar
0 votes
1 answer
52 views

SwiftyJSON not working with WebSocket message

I have a socket response that is this: {"op":0,"d":{"author":{"id":"6699457769390473216","name":"Test","verified":false},...
austttn19's user avatar
1 vote
2 answers
238 views

How to use SwiftyJSON to parse data with abiguous types?

I have JSON structured like this: { "data": [ { "value":["val1", "val2", "val3"] }, { "value":"val" }...
Arjun's user avatar
  • 484
0 votes
0 answers
99 views

Trying to get JSON from a server, but i keep getting an error saying it's invalid

I'm having a problem with my code where I'm using AlamoFire and SwiftyJSON trying to get a JSON from a server, however, I keep getting this error: responseSerializationFailed(reason: Alamofire.AFError....
Aboud Jbara's user avatar
1 vote
3 answers
322 views

swifty json parse array object

how can I set an array of Images to an images variable of the Car class my json: { "Description": "test comment", "GalleryId": 5548, "ShortCode": &...
Kerim Khasbulatov's user avatar
-1 votes
1 answer
194 views

Get JSON Object from JSON Response in Swift

I want to fetch LoginOperationResponseBody key from the following JSON response in Swift. [ { "LoginOperationResponseHeader": { "ReponseCode": 1, ...
Muhammad Hasan Irshad's user avatar
0 votes
3 answers
2k views

How to parse JSON from Yahoo Finance in Swift for MacOS

I've been struggling with this one! I've got Alamofire and SwiftyJSON. I use Alamofire to get a JSON result from Yahoo Finance like this: public func getYahooQuote(symbol: String) { let ...
kanaloa's user avatar
  • 41
1 vote
1 answer
254 views

SwiftyJson get value from array in dictionary

I've been trying to retrieve the value of code for a while now. This is the json I'm getting back from the server: { "message": "The given data was invalid.", "errors&...
Tommydr's user avatar
  • 33
1 vote
1 answer
790 views

How to concatenate two json objects with Swifty JSON

I'm using Swifty JSON (https://github.com/SwiftyJSON/SwiftyJSON). I have searched and found a close one here (How to combine two SwiftyJSON objects). I have exactly the same question. But the answers ...
Feng's user avatar
  • 105
1 vote
1 answer
187 views

Parsing JSON with multiple identical identifiers in Swift

Im trying to parse JSON data from an RestAPI that gives me energy data for Norway (https://driftsdata.statnett.no/restapi/ProductionConsumption/GetLatestDetailedOverview) <...
Nisse82's user avatar
  • 41
1 vote
1 answer
364 views

Why am I getting nil for the Int64 value?

I run this code and get clients names correctly, but when it comes to integers (number of awards, number of cars, number of dogs), it seems that I am not getting anything from the API (the ‘?? 0’ part ...
Caleb G's user avatar
  • 79
0 votes
1 answer
49 views

Requesting URL and Parsing The Result In A Alert

I have made the variables global, but I have not been able to figure out how to show the alert after it has gotten the response. Not sure if I have to create function or not. Anything would be helpful....
SkrtOnDiscord's user avatar
0 votes
1 answer
96 views

How to post Data on server in it's actual format?

I am posting my parameters data on server as below. let parameters : [String : Any] = [ "cartdata" : cartArr, //cartArr is an array "previewcart&...
saumya ranjan Gangwar's user avatar
0 votes
1 answer
4k views

Swift - Type '(String, JSON)' cannot conform to 'StringProtocol'; only struct/enum/class types can conform to protocols

I'm using SwiftyJSON. Ultimately I want to see if the "date" value equals the value of selectedDate and if so, print the "event" value. But I haven't even got that far yet. I'm ...
jarrodwhitley's user avatar

1
2 3 4 5
21