         didSet {
             fatalError("Not yet supported")
         }
+    }
+    
+    public var selectedIndex: Int {
+        return headerCollectionView.indexPathsForSelectedItems?.first?.item ?? 0
     }
     
     fileprivate var previousContentOffset = CGPoint(x: 0, y: 0)

    public override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) {
        coordinator.animate(alongsideTransition: { (_) in
            self.headerCollectionView.collectionViewLayout.invalidateLayout()
            self.headerCollectionView.reloadData()
            self.headerCollectionView.collectionViewLayout.invalidateLayout()
            self.contentCollectionView.reloadData()
        }, completion: nil)
    }
}

            contentCollectionView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
            ])
        
        reloadData()
        selectTab(at: 0)
    }
    
