HenrikSwahn / DV1431

0 stars 0 forks source link

Create a @NSManaged Object for WishListItem #3

Closed devinant closed 8 years ago

devinant commented 8 years ago

WishListItem needs a @NSManaged Core Data object. The code for this class is located in WishListTableViewController.

In addition: The MediaType enum must perhaps be redeclared if CoreData cannot use enums.

Affected code:

enum MediaType: String {
    case Movie  = "Movie"
    case Music  = "Music"
    case Game   = "Game"
    case Book   = "Book"
}

struct WishListItem {
    // ID for the item in CoreData? 
    // Not sure about this one: Does CoreData handle IDs like real database?
    var id: Int

    // ID for the item in the API (this will later be used when the wishlist item is imported to the main library)
    var aid: String

    // Type of media
    var type: MediaType

    // The cover art for the media
    var imageData: NSData?

    // Title for the item
    // Movie: This is should contain the title of the movie
    // Album: This is should contain the title of the album
    // Game: This should contain then name of the game
    // Book: This should contain the title of the book
    var title: String

    // Detail
    // Movie: This should be empty (optional)
    // Album: This should contain the artist
    // Game: This should be empty
    // Book: This should contain author
    var detail: String?
}