Skip to content

DiscoverTV

George Kye edited this page Oct 26, 2016 · 3 revisions

DiscoverTV

DiscoverTV ->returns [TVMDB]

Basic query

    DiscoverTVMDB.discoverTV(apikey, language: "EN", sort_by: nil, page: 1){
            apiReturn in
            let tvshows = apiReturn.data!
            print(tvshows[0].name)
            print(tvshows[0].overview)
            print(tvshows[0].popularity)
        }

Discover TV shows in "Asia/Dubai" timezone, start query on page 3

    DiscoverTVMDB.discoverTV(apikey, language: "en", page: 1){
      ClientReturn, tvshows in
      if let tvshows = tvshows{
        print(tvshows[0].name)
        print(tvshows[0].overview)
        print(tvshows[0].popularity)
      }
    }

Discover shows which first aired in 2002

    DiscoverTVMDB.discoverTV(apikey, language: "EN", sort_by: .popularity_desc, page: 1, first_air_date_year: "2000"){
      apiReturn, tvShows in
      if let tvshows = tvShows{
        print(tvshows[0].name)
        print(tvshows[0].overview)
        print(tvshows[0].popularity)
      }
    }

Discover popular Scifi & Fantasy shows on HBO network

    DiscoverTVMDB.discoverTVWith(apikey, with_genres: TVGenres.ScifiFantasy.rawValue, with_networks: "49",                                  sort_by: DiscoverSortByTV.popularity_desc.rawValue, language: nil, page: nil){
      apiReturn, tvShows in
      if let tvshows = tvShows{
        print(tvshows[0].name)
        print(tvshows[0].overview)
        print(tvshows[0].popularity)
      }
    }
Clone this wiki locally