2
I use a library called Alamofire-Swiftyjson to make a request JSON
.
Call example:
Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"])
.responseSwiftyJSON({ (request, response, json, error) in
println(json)
println(error)
})
This url is just an example, my return JSON
That’s the way it is:
Example of JSON return:
{
"titulo1": "Silvio Santos Ipsum",
"texto1": "Ma vai pra lá. Ma vai pra lá. Ma você, topa ou não topamm. O prêmio é em barras de ouro, que vale mais que dinheiroam. Ma vejam só, vejam só. Mah você não consegue né Moisés?",
"url1": "http://lorempixel.com/image_output/abstract-q-g-263-221-3.jpg",
"url2": "http://lorempixel.com/image_output/abstract-q-g-263-221-3.jpg",
"url3": "http://lorempixel.com/image_output/abstract-q-g-263-221-3.jpg",
"titulo2": "Patríciaaammmm... Luiz Ricardouaaammmmmm.",
"texto2": "É namoro ou amizadeemm? Ma vale dérreaisam? Você veio da caravana de ondeammm? Ma não existem mulher feiam, existem mulher que não conhece os produtos Jequitiamm. Um, dois três, quatro, PIM, entendeuam? Patríciaaammmm... Luiz Ricardouaaammmmmm. O Raul Gil é gayam! ... Maa O Ah Ae! Ih Ih! O Raul Gil é gayamm! Mah é a porta da esperançaam."
}
I’ll always follow the pattern:
- title + number
- text + number
And sometimes :
- url + number.
How can I popular my view with this information?
Will this JSON have only one field? Or N fields? In general I would suggest you assemble a solution using uitableview and custom cells. At the moment not put a complete answer because I am without time to give all the necessary details.
– Otávio
@Otávio will have n fields why it will be a normal text page, with a title field that will have a bold font with larger font is a text field with reduced font and no bold and images
– Gabriel Rodrigues
But my question was more in the sense: Will this structure Titles + Images be repeated? For example
[ silvioSantos, ratinho, xuxa, faustoSilva]
? Where each celebrity would have their own titles and images?– Otávio
@Octavian titles and texts will now repeat images will not be on all screens.
– Gabriel Rodrigues