How did you manage to pull the news articles in the stories view?
- I actually used the News API (https://newsapi.org/) and got a hold of the JSON they provide for their latest MTV articles; using the MVC pattern.
How did you manage to load the snaps?
- I actually wrote up a simple node.js server that I've hosted up on Heroku (https://snapchat-nodejs.herokuapp.com/posts) and again I used the MVC pattern to fetch and display those snaps. Here's an example of my Snap Object:
class Snap: NSObject {
var username: String?
var timestamp: NSNumber?
var type: String?
var bitmoji: String?
var isRead: Bool?
var content: String?
init(username: String?, timestamp: NSNumber?, type: String?, bitmoji: String?, isRead: Bool?, content: String?) {
self.username = username
self.timestamp = timestamp
self.type = type
self.bitmoji = bitmoji
self.isRead = isRead
self.content = content
}
}
- Daniel Dramond [email protected]
© Daniel Dramond