TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Mar 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Adam Fish.
Ready-to-go JSON parsing of New York Times Top Stories API into Realm models
Included are pre-built model files: NYTStory
and NYTStoryImage
that represent the associated data for each story returned from the Top Stories API.
Go to Times Developer Network and register, then enable the key for the Top Stores API.
RealmNYTStories
is available through CocoaPods. To install it, simply add the following line to your Podfile:
Objective-C
pod 'RealmNYTStories'
Swift
pod 'RealmSwiftNYTStories'
Objective-C
// Call somewhere in your code
// Performs async request, parses JSON, and adds objects to given Realm
[NYTStory loadLatestStoriesIntoRealm:[RLMRealm defaultRealm]
withAPIKey:@"INSERT_YOUR_API_KEY_HERE"];
Swift
// Call somewhere in your code
// Performs async request, parses JSON, and adds objects to given Realm
NYTStory.loadLatestStories(intoRealm: try! Realm(), withAPIKey: "INSERT_YOUR_API_KEY_HERE")