VLCMediaSubcategory+VLCDragAndDrop.swift 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*****************************************************************************
  2. * VLCMediaSubcategory+VLCDragAndDrop.swift
  3. * VLC for iOS
  4. *****************************************************************************
  5. * Copyright (c) 2017 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Carola Nitz <caro # videolan.org>
  9. *
  10. * Refer to the COPYING file of the official project for license.
  11. *****************************************************************************/
  12. import Foundation
  13. @available(iOS 11.0, *)
  14. extension VLCMediaSubcategory: VLCDragAndDropManagerDelegate {
  15. func dragAndDropManagerRequestsFile(manager: NSObject, atIndexPath indexPath: IndexPath) -> Any? {
  16. return files[indexPath.row]
  17. }
  18. func dragAndDropManagerInsertItem(manager: NSObject, item: NSManagedObject, atIndexPath indexPath: IndexPath) {
  19. if item as? MLLabel != nil && indexPath.row < files.count {
  20. files.remove(at: indexPath.row)
  21. }
  22. // TODO: handle insertion
  23. //files.insert(item, at: indexPath.row)
  24. }
  25. func dragAndDropManagerDeleteItem(manager: NSObject, atIndexPath indexPath: IndexPath) {
  26. files.remove(at: indexPath.row)
  27. }
  28. func dragAndDropManagerCurrentSelection(manager: NSObject) -> AnyObject? {
  29. //TODO: Handle playlists and Collections
  30. fatalError()
  31. }
  32. func dragAndDropManagerRemoveFileFromFolder(manager: NSObject, file: NSManagedObject) {
  33. //TODO: handle removing from playlists and Collections
  34. fatalError()
  35. }
  36. }