0

I am trying to display a screen that shows a collection of video thumbnails, and when the user taps one of the thumbnails that video opens up. I have two view controllers, one being the collection view and one being the video player, and both are embedded in a navigation controller. I have the following code:

extension BrowserCollectionViewController {
    override func collectionView(_ collectionView: UICollectionView,
                                 shouldSelectItemAt indexPath: IndexPath) -> Bool {
        self.performSegue(withIdentifier: "ShowPlayer", sender: indexPath)
        return false
    }

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if segue.identifier == "ShowPlayer" {
            guard let sender = sender as? IndexPath else {
                return
            }
            if let playViewController = segue.destination as? PlayerViewController {
                playViewController.metadata = movies[movieIndex(sender)]
            }
        }
    }
}

This works fine, except that the transition looks like a standard push segue and I would like it to look like the thumbnail expands to become the view controller (the player also happens to hide the navigation bar so it looks like a full-screen view). This looks exactly like the behavior of the original Photos app, so I thought it might be a standard transition.

wizplum
  • 427
  • 5
  • 17
  • we don't have standard transition like photos app - https://medium.com/@masamichiueta/create-transition-and-interaction-like-ios-photos-app-2b9f16313d3 – canister_exister Dec 28 '18 at 18:35
  • It is “standard” but not built in. You have to write a custom transition animation. There’s lots of discussion explaining how to do it. – matt Dec 28 '18 at 18:35

0 Answers0