WWERApp allows you to view information about consoles and video games such as avaliability and prices by taking API data from alerts by social media accounts and other existing game information websites.
[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)
[Add picture of your hand sketched wireframes in this section]
Property | Type | Description |
---|---|---|
image | File | Image that user posts |
userName | String | Name of user account |
like | Number | Number of likes in a specific post |
objectId | String | Unique id for the user post (default field) |
password | String | Password of a specific userName |
description | String | Description of the product posted |
price | Number | Price of items |
author | String | Creator of the post |
@IBAction func signInButton(_ sender: Any) {
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)")
}
}
}
@IBAction func signUpButton(_ sender: Any) {
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)")
}
}
}
Home Screen
func tableView(_ tableView: UITableView , numberofRowsinSection section: Int) -> Int { let post = posts[section] return post }
tableView.reloadData()
* (Create/POST) Create a new comment
@IBAction func onSubmitButton(_ sender: Any) { let post = PFObject(className: "Posts")
post["caption"] = commentField.text! post["auther"] = PFUser.current()!
let imageData = imageView.image!.pngData() let file = PFFileObject(name: "image.png", data: imageData!) post["image"] = file post.saveInBackground { (success, error) in if success { self.dismiss(animated: true, completion: nil) print("saved!") } else { print("error") } } }
Product Information Screen
(Create/POST) create a new like let like = PFObject(classname: "like") like["user"] = PFUser.current() like["post"] = post
post.add(like, forKey: "likes")
post.saveInBackground(){ (success, error) in if success { print("like saved") } else { print("error saving like") } }
let post = posts[indexPath.row]
let price = post["price"] as! Double
(Update/PUT) Put image of product
let post = posts[indexPath.row]
let image = post["image"]
User settings Screen
let user = PFUser.current()
let name = user.username
let user = PFUser.current()
let email = user.email
let user = PFUser.current()
let zipCode = user["zipcode"] as! Int
![ezg