Super easy to use Udacity Auth and Classroom APIs client for iOS
⚠️ 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
Get User's basic info, Courses, Nanodegrees, and much more with few lines of code
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. }// 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 }- This project relies on Udacity Classroom API
- UDClient uses Alamofire for networking.
- iOS 8+
- Xcode 9+
- Swift 4
To integrate UDClient into your Xcode project using CocoaPods, specify it in your Podfile:
pod 'UDClient'Add the Sources folder to your Xcode project.
Don't forget to install dependencies from the Podfile
UDClient is released under the MIT license. See LICENSE for details.