Created
July 23, 2015 11:46
-
-
Save kesar/6b8273e05005f6ba53d3 to your computer and use it in GitHub Desktop.
builder swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Api.swift | |
Api().getFeedItems { (FeedItems) -> () in | |
// do something with [FeedItem] | |
} | |
// inside of getFeedItems | |
FeedItem = FeedItemFactory.FeedItemFromJSON(feedItemJSON) | |
// inside of FeedItemFactory.FeedItemFromJSON (I use SwiftyJSON) | |
let feedItem = FeedItem() | |
if let id = feedItemJSON["id"].int { | |
feedItem.id = id.toInt()! | |
} | |
... | |
return feedItem | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment