Skip to content
This repository has been archived by the owner on Feb 8, 2021. It is now read-only.

Decode array of URLs #81

Closed
ishaq opened this issue Nov 11, 2015 · 3 comments
Closed

Decode array of URLs #81

ishaq opened this issue Nov 11, 2015 · 3 comments
Labels
Milestone

Comments

@ishaq
Copy link

ishaq commented Nov 11, 2015

right now this would fail

let imageURLs:[NSURL] = ("imageURLs" <~~ json)!

we have to do this instead:

// Get an array of strings first
let imageURLStrings:[String] = ("imageURLs" <~~ json)!
// now convert it to an array of URLs manually
var imageURLs:[NSURL] = []
for var i = 0; i < imageURLStrings.count; i++ {
    let currentURL = NSURL(string: imageURLStrings[i])!
    imageURLs.append(currentURL)
}

I'll try to figure out how to do it in Gloss and submit a PR. Or if it's a quick fix, I'll let @hkellaway take care of it.

@hkellaway hkellaway added the bug label Nov 11, 2015
@hkellaway hkellaway added this to the 0.6.1 milestone Nov 11, 2015
@hkellaway
Copy link
Owner

good call @ishaq - i will fix this

@hkellaway
Copy link
Owner

now available if you point your pod/cartfile to develop - will be available in the next, 0.6.1, release

@ishaq
Copy link
Author

ishaq commented Nov 11, 2015

great :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants