     override func viewDidDisappear(_ animated: Bool) {
         super.viewDidDisappear(animated)
         
-        currentSkinName = nil
+        nextSkinName = nil
+    }
+    
+    override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) {
+        
+        vertSizeClass = newCollection.verticalSizeClass
+        
+        coordinator.animate(alongsideTransition: { [weak self] context in
+            self?.collectionView.performBatchUpdates(nil, completion: nil)
+            }, completion: { [weak self] context in
+                self?.collectionView.reloadData()
+        })
+        
+        //        coordinator.animate(alongsideTransition: nil) { [weak self] _ in
+        //            self?.collectionView.collectionViewLayout.invalidateLayout()
+        //            self?.collectionView.reloadData()
+        //        }
     }
 }
 

        if let skinCell = cell as? SkinCell {
            
            let model = viewModel[indexPath.row]
            skinCell.skinImage.af_setImage(withURL: model.portraitUrl)
        }
        
        return cell

        
        navigationController?.hidesBarsOnTap = true
        navigationController?.navigationBar.backItem?.title = " "
        currentSkinName = nil
    }
    
    override func viewDidAppear(_ animated: Bool) {
