瀏覽代碼

MediaDataSource: Added a Mediatype with Category and Subctegory to show the correct content on the subviews

Carola Nitz 7 年之前
父節點
當前提交
a89d9f9be6
共有 2 個文件被更改,包括 5 次插入2 次删除
  1. 3 2
      Sources/MediaViewController.swift
  2. 2 0
      Sources/VLCMediaData+VLCDragAndDrop.swift

+ 3 - 2
Sources/MediaViewController.swift

@@ -51,6 +51,7 @@ public class VLCMediaViewController: UICollectionViewController, UISearchResults
         self.services = services
         mediaType = type
         rendererButton = services.rendererDiscovererManager.setupRendererButton()
+
         super.init(collectionViewLayout: UICollectionViewFlowLayout())
         NotificationCenter.default.addObserver(self, selector: #selector(themeDidChange), name: .VLCThemeDidChangeNotification, object: nil)
         if mediaType.category == .video {
@@ -70,7 +71,7 @@ public class VLCMediaViewController: UICollectionViewController, UISearchResults
     }
 
     @available(*, unavailable)
-    public required init?(coder aDecoder: NSCoder) {
+    required public init?(coder aDecoder: NSCoder) {
         fatalError("init(coder: ) has not been implemented")
     }
 
@@ -169,7 +170,7 @@ public class VLCMediaViewController: UICollectionViewController, UISearchResults
 
     // MARK: - MediaDatasourceAndDelegate
 
-    public override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+    override public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
         delegate?.mediaViewControllerDidSelectMediaObject(self, mediaObject: services.mediaDataSource.object(at: indexPath.row, subcategory: mediaType.subcategory))
     }
 

+ 2 - 0
Sources/VLCMediaData+VLCDragAndDrop.swift

@@ -23,6 +23,7 @@ extension VLCMediaDataSource: VLCDragAndDropManagerDelegate {
             removeObject(at: indexPath.row, subcategory: manager.mediaType.subcategory)
         }
         insert(item as! MLFile, at: indexPath.row, subcategory: manager.mediaType.subcategory)
+
     }
 
     func dragAndDropManagerDeleteItem(manager: VLCDragAndDropManager, atIndexPath indexPath: IndexPath) {
@@ -30,6 +31,7 @@ extension VLCMediaDataSource: VLCDragAndDropManagerDelegate {
     }
 
     func dragAndDropManagerCurrentSelection(manager: VLCDragAndDropManager) -> AnyObject? {
+
         //  TODO: Handle playlists and Collections
         fatalError()
     }