Content

class Content : Hashable

Self defined Content , the source we put in the app is saved as this format

  • Self defined operator ==, return true if both equals, else return false

    Declaration

    Swift

    static func == (lhs: Content, rhs: Content) -> Bool
  • Perform hash

    Declaration

    Swift

    func hash(into hasher: inout Hasher)

Properties

  • This is a UIImage which is used to display thumbnail of Content

    Declaration

    Swift

    var thumbnail: UIImage
  • This is the title of Content

    Declaration

    Swift

    let title: String
  • Number of views of Content

    Declaration

    Swift

    let views: Int
  • The relatedChannel of Content

    Declaration

    Swift

    let channel: Channel
  • Duration of Content

    Declaration

    Swift

    var duration: Int
  • Content Link, used to fetch content from this given link

    Declaration

    Swift

    var contentLink: URL
  • Number of likes for the Content

    Declaration

    Swift

    var likes: Int
  • Number of dislikes for the Content

    Declaration

    Swift

    var disLikes: Int
  • id

    ID for the content

    Declaration

    Swift

    var id: Int
  • This is the description of the Content

    Declaration

    Swift

    var description: String
  • This is a list of Contents which is used to store suggested Contents, the suggested Content will base on the current Content‘s name

    Declaration

    Swift

    var suggestedContents: [Content]
  • Initialization of wiki

    Declaration

    Swift

    var wiki: Wiki

Inits

  • Performe Content initialization

    Declaration

    Swift

    init(title: String, id: Int, channelName: String, description: String, url: URL)
  • Aviode directly calling generateContentInfo

    Declaration

    Swift

    func fetchContentInfo()
  • Aviode directly calling fetchSuggestedContents

    Declaration

    Swift

    func fetchSuggestedContents()
  • Fetch Content‘s WikiChunk

    Usage Example:

     content.fetchWikiChunkEnrichments()
    

    Declaration

    Swift

    func fetchWikiChunkEnrichments()
  • Increase number of likes

    Declaration

    Swift

    func like()
  • Undocumented

    Declaration

    Swift

    func unlike()
  • Increase number of dislikes

    Declaration

    Swift

    func dislike()
  • Undocumented

    Declaration

    Swift

    func undislike()