appssemble / appstore-card-transition

Appstore card animation transition. UICollectionView and UITableView card expand animated transition for iOS
MIT License
583 stars 52 forks source link

Crash on cell Getting #15

Open veersr9 opened 4 years ago

veersr9 commented 4 years ago
   `private func showType2(indexPath: IndexPath, bottomDismiss: Bool = false) {
    let storyboard = UIStoryboard(name: "Main", bundle: nil)
    let viewController = storyboard.instantiateViewController(withIdentifier: "type2") as! Type2ViewController

    // Get tapped cell location
    let cell = tableview.cellForRow(at: indexPath) as? CardCollectionViewCell
    cell!.settings.cardContainerInsets = UIEdgeInsets(top: 8.0, left: 16.0, bottom: 8.0, right: 16.0)
    cell!.settings.isEnabledBottomClose = bottomDismiss

    transition = CardTransition(cell: cell!, settings: cell!.settings)
    viewController.settings = cell!.settings
    viewController.transitioningDelegate = transition

    // If `modalPresentationStyle` is not `.fullScreen`, this should be set to true to make status bar depends on presented vc.
    //viewController.modalPresentationCapturesStatusBarAppearance = true
    viewController.modalPresentationStyle = .custom

    presentExpansion(viewController, cell: cell!, animated: true)
}`

"Fatal error: Unexpectedly found nil while unwrapping an Optional value: file- cell is getting nil"

League2EB commented 4 years ago

Has this problem been solved?

League2EB commented 4 years ago

@chelemen-razvan @SpectralDragon Please help !

SpectralDragon commented 4 years ago

Not enough information to solve your problem. Seem like you don't implement CardCollectionViewCell for your cells.

League2EB commented 4 years ago

like @SpectralDragon I added the following code to my controller to run,it's ok


extension AViewController: CardsViewController {

}


but , please the issues ... i don't understand how to fix it 

this is my BViewConrollerCode and [Video](http://xuanci.tw/kmc/issues/ErrorSample.mp4)

```swift
extension BViewController: CardDetailViewController {

    var cardContentView: UIView {
        return collectionView
    }

    var scrollView: UIScrollView? {
        return collectionView
    }

}