Contents

maximbilan/swiftoxfordapi

A framework to consume the <a href="https://developer.oxforddictionaries.com/documentation">Oxford Dictionaries API</a> written in Swift.</br>

Installation

<b>CocoaPods:</b> <pre> pod 'SwiftOxfordAPI' </pre> <b>Carthage:</b> <pre> github "maximbilan/SwiftOxfordAPI" </pre> <b>Swift Package Manager:</b> <pre> dependencies: [ .package(url: "https://github.com/maximbilan/SwiftOxfordAPI", from: "0.2")) ] </pre> <b>Manual:</b> <pre> Copy <i>SwiftOxfordAPI.swift</i> to your project. </pre>

Initialization

First of all you have to generate API ID and APP key. And then use the following code:

SwiftOxfordAPI.shared.start(appId: "APP_ID_HERE", appKey: "APP_KEY_HERE")

Using

Right now the framework is supported only two requests: entries and translation. For example:

SwiftOxfordAPI.shared.entries(language: "en", word: "queen", region: "us", filters: "grammaticalFeatures=singular,past;lexicalCategory=noun") { [weak self] (data, error) in
    self?.handleResponse(data, error)
}
SwiftOxfordAPI.shared.translation(sourceLanguage: "en", word: "queen", targetLanguage: "es") { [weak self] (data, error) in
    self?.handleResponse(data, error)
}

To do:

Unfortunately, I stopped working on this repository because I don't need it for the moment. It's not difficult to expand the methods, just follow the implemented code. There is a list below of services which were already implemented. So, If you need more, please create a pull request with implemented services, I'll accept it.

  • [x] Entries
  • [x] Translation
  • [ ] Sentences
  • [ ] Lemmatron
  • [ ] Thesaurus
  • [ ] LexiStats
  • [ ] Search
  • [ ] Wordlist
  • [ ] Utility

License

<i>SwiftOxfordAPI</i> is available under the MIT license. See the LICENSE file for more info.

Package Metadata

Repository: maximbilan/swiftoxfordapi

Default branch: master

README: README.md