Swift framework to communicate with the OttoRadio public API https://developers.ottoradio.com
- iOS 10.0+
To install it, simply add the following line to your Cartfile:
github "ranunez/OttoRadioKit"
Run carthage update
to build the framework and drag the built OttoRadioKit.framework
into your Xcode project.
import OttoRadioKit
Retrieve Stories
APIHandler.retrievePodcasts(type: .trending, query: "apple", count: nil) { (podcasts) in
if let podcasts = podcasts {
print("Retrieved \(podcasts.count) podcasts")
} else {
print("Error retrieving podcasts")
}
}
APIHandler.retrieveNews(type: .relevance, query: "government", count: nil) { (news) in
if let news = news {
print("Retrieved \(news.count) news")
} else {
print("Error retrieving news")
}
}
Retrieve a Playlist
APIHandler.retrievePlaylist(query: "tech", length: nil, mix: nil) { (playlist) in
if let playlist = playlist {
print("Retrieved \(playlist.title)")
} else {
print("Error retrieving playlist")
}
}