Analyzes the different features of a Spotify user's songs and playlists, and allows them to share with friends/followers through created posts.
[Evaluation of your app across the following attributes]
Required Must-have Stories
Optional Nice-to-have Stories
Tab Navigation (Tab to Screen)
Flow Navigation (Screen to Screen)
Post (Discover Screen) | Property | Type | Description |
---|---|---|---|
clientID | String | ID for user (handle) | |
author | Pointer to User | user's display name | |
objectID | String | ID for user post | |
caption | String | a text box for user post | |
image | File | user of post's profile image | |
likesCount | Number | number of likes on a post | |
commentsCount | Number | count of comments on a post | |
postTime | DateTime (String) | displays how long ago post was published |
Register Screen
let user = PFUser()
user.username = usernameField.text
user.password = passwordField.text
user.signUpInBackground { (success, error) in
if success {
self.performSegue(withIdentifier: "loginSegue", sender: nil)
}
else {
print("Error: \(error?.localizedDescription)")
}
}
Login Screen
let username = usernameField.text!
let password = passwordField.text!
PFUser.logInWithUsername(inBackground: username, password: password) { (user, error) in
if user != nil {
self.performSegue(withIdentifier: "loginSegue", sender: nil)
}
else {
print("Error: \(error?.localizedDescription)")
}
}
Create post screen
let post = PFObject(className: "Posts")
post["caption"] = commentField.text!
post["author"] = PFUser.current()!
post.saveInBackground { (success, error) in if success { self.dismiss(animated: true, completion: nil) print ("saved!") } else { print("error!") } }
Home Screen
(Create/POST) Create a new like on a post
var likes = PFObject(className:"Likes")
likes["post"] = selectedPost
likes["author"] = PFUser.current()!
selectedPost.add(likes, forKey: "likes")
// Saves the new object.
selectedPost.saveInBackground {
(success: Bool, error: Error?) in
if (success) {
print ("Comment saved")
} else {
print ("Error saving comment")
}
(Create/POST) create a new comment on a post
var comment = PFObject(className:"Comments")
comment["text"] = text
comment["post"] = Post
comment["author"] = PFUser.current()!
Post.add(comment, forKey: "comments")
// Saves the new object.
Post.saveInBackground {
(success: Bool, error: Error?) in
if (success) {
print ("Comment saved")
} else {
print ("Error saving comment")
}
Existing API Endpoints
HTTP Verb | Endpoints | Description |
---|---|---|
GET | SPTAppRemoteAlbum | gets album name and URI |
GET | SPTAppRemoteArtist | gets artist's name and URI |
GET | SPTAppRemoteTrack | gets current track's name URI, duration, artist, album, if it's saved, and what episode and podcast |
GET | SPTAppRemotePlayerAPI | gets Spotify player |
GET | imageAPI | gets images from Spotify app |
GET | userAPI | gets user data from Spotify app |
Walkthrough of implemented user stories for sprint 1: