     
     func saveDetailMovie(detailMovie: MovieDetail?, forId: Int!) {
         let userDefaults = UserDefaults.standard
-        userDefaults.setValue(detailMovie?.toJSONString(), forKey: String(format:DefaultKey.detail.rawValue, forId))
-        userDefaults.synchronize()
-        NSLog("Objeto armazenado nas preferencias!")
+        if (detailMovie?.favorite)! {
+            userDefaults.setValue(detailMovie?.toJSONString(), forKey: String(format:DefaultKey.detail.rawValue, forId))
+            userDefaults.synchronize()
+            NSLog("Objeto armazenado nas preferencias!")
+            
+        } else {
+            userDefaults.removeObject(forKey: String(format:DefaultKey.detail.rawValue, forId))
+            userDefaults.synchronize()
+            NSLog("Objeto removido das preferencias!")
+        }
     }
     
     func getDetailMovie(forId: Int!) -> MovieDetail? {

        for (key, value) in userDefaults.dictionaryRepresentation() {
            if (key.contains("movie-tending")) {
                let movieTrending = Mapper<MovieTrending>().map(JSONString: value as! String)
                trendingMovies.add(movieTrending as Any)
                NSLog("Objeto resgatado das preferencias!")
            }
        }

        for (key, _) in userDefaults.dictionaryRepresentation() {
            if (key.contains("movie-tending")) {
                userDefaults.removeObject(forKey: key)
                userDefaults.synchronize()
                NSLog("Objeto removido das preferencias!")
            }
        }
