3
votes
1answer
66 views

Creating a array of custom objects from JSON, sent using PHP from a MySQL database

I'm using PHP to send data in JSON to create an array of custom objects in Swift. I've been told retrieveData() is bad code because it's in an infinite loop. I'm ...
1
vote
1answer
63 views

Read JSON as a dictionary of country codes and names

For a small system I need the Country Code mapped to the country name (e.g. "GB"-> "United Kingdom"). To accomplish that I read a JSON file and save it to a dictionary using swiftyJSON. Is there a ...
2
votes
1answer
89 views

REST API client

I am new in iOS development and Swift. I am going to develop a simple application which communicates with external REST services. This is my first experiment. I appreciate feedback on best ...
2
votes
2answers
97 views

Checking an authentication decision in a JSON response

I've been working on this login screen logic. It checks for the parameters in the JSON response to decide which action to follow. It works but it's kinda ugly and verbose. Any suggestions to ...
3
votes
1answer
920 views

Displaying JSON data from a server in a UICollectionView

This code pulls JSON from a server and delivers some data like imageURL, titleString and ...
2
votes
0answers
51 views

Correct Swift Model for JSON

I am working on a program that would generate swift classes/ structures for JSON file contents. The link to the application is Json2Model in case you want to contribute directly. I do not know a ...
4
votes
2answers
177 views

Getting JSON data from an HTTP response using conditional binding

I am new to Swift and I am trying to use the optional binding feature in as efficient way as possible but I am a bit confused on how to use it (if I can) in this scenario: ...
2
votes
0answers
85 views

Parsing JSON with generics

I get back two dictionaries, I need to parse through them and put in an array two objects. I think I did a very poor job and I have a feeling there is a better way to make the code more compact and ...
3
votes
1answer
655 views

Building Weather Forecast from JSON with optionals

I am looking for the best way of parsing JSON in Swift 2.0. I have this JSON ...
3
votes
1answer
543 views

Second attempt at Hangman in Swift

I recently posted my Hangman game, and got some amazing feedback! The main thing suggested was to create a word generator that could read JSON files so that my hangman brain class didn't have to ...
4
votes
1answer
98 views

Concatenating a SoundCloud Playlist Update JSON

I am currently working on an implementation of SoundCloud for a 3rd party iOS app, and as there is no SDK anymore I am doing all my calls via Alamofire. This is what SC expects you to send in your ...
4
votes
2answers
444 views

Asynchronous HTTP JSON request

For asynchronous requests, I use Alamofire. I have created one method for requesting async data. ...
4
votes
2answers
176 views

Fetching the definition of a word using a REST API

This is the code I'm using to GET the definition of a word from Wordnik's REST API. I don't want to ignore any error but this is causing the code to be ridiculously long. I'm new to Swift so I'd ...
4
votes
1answer
13k views

Swift extension: Dictionary<String, AnyObject> to JSON string for URL parameter

Here's a quick extension for [String: AnyObject] dictionaries in Swift. The output needs to be in the following format (order and spacing don't matter): ...
5
votes
1answer
7k views

Swift project using PHP web service

I was hoping for someone to review my current project, which was created in Swift and uses a PHP web service. I'm not worried about UI elements, as this is just a 'test' project, but I'm concerned ...