Latest 0.3.2
Homepage https://github.com/omaralbeik/UDClient
License MIT
Platforms ios 8.0, requires ARC
Dependencies Alamofire
Authors

Super easy to use Udacity Auth and Classroom APIs client for iOS

Swift
Xcode
MIT


⚠️ To use with Swift 3 / Xcode 8.x please ensure you are using v0.1.1.

⚠️ To use with Swift 4 / Xcode 9.x please ensure you are using v0.3.2


Usage

Get User’s basic info, Courses, Nanodegrees, and much more with few lines of code

Get Access Token

UDClient.shared.requestToken(email: email, password: password) { error, token in
  if error != nil {
    // handle error
    return
  }

  // get token
  let token = token?.string

  // get token expiry date
  let expiryDate = token?.expiryDate

  // check if token is expired
  let isExpired = token?.isExpired

  // store the token.
}

Get User Info


// all user info
let fields: UDUser.allFields

// basic user info
let fields: [UDUser.fields] = [.id, .firstName, .lastName, .email]
// and more ..

// user Nanodegrees
let fields: [UDUser.fields] = [.nanodegrees(fields: [.title, .summary])]
// and more ..

// Nanodegree hero image
let fields: [UDUser.fields] = [.nanodegrees(fields: [.heroImage(fields: [.url])])]
// and more

UDClient.shared.fetchUserInfo(token: token, fields: fields) { error, user in
  if error != nil {
    // handle error
    return
  }

  // print user debug description for easy debugging
  print(user?.debugDescription)
  // do something else with user info
}

Structure

Model:

Services:

Udacity Classroom API:

Dependencies:

Requirements:

  • iOS 8+
  • Xcode 9+
  • Swift 4

Installation

CocoaPods

To integrate UDClient into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'UDClient'

Manually

Add the Sources folder to your Xcode project.

Don’t forget to install dependencies from the Podfile

License

UDClient is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "UDClient",
    "version": "0.3.2",
    "summary": "Super easy to use Udacity Auth and Classroom APIs client for iOS",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "homepage": "https://github.com/omaralbeik/UDClient",
    "authors": {
        "Omar Albeik": "omaralbeik@gmail.com"
    },
    "social_media_url": "https://twitter.com/omaralbeik",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/omaralbeik/UDClient.git",
        "tag": "0.3.2"
    },
    "source_files": "Sources/**/*.swift",
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.0"
    },
    "dependencies": {
        "Alamofire": [
            "~> 4.5"
        ]
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This