ivanvorobei / SPStorkController

Now playing controller from Apple Music, Mail & Podcasts Apple's apps.
https://opensource.ivanvorobei.io
MIT License
2.74k stars 204 forks source link

Error with updatePresentingController(modal: #100

Closed DyakoVlad closed 5 years ago

DyakoVlad commented 5 years ago

I am trying to update SPStorkController like this:

let modal = TourCodeStartTourViewController(nibName: "TourCodeStartTourViewController", bundle: nil)
let transitionDelegate = SPStorkTransitioningDelegate()
transitionDelegate.cornerRadius = 25
modal.transitioningDelegate = transitionDelegate
modal.modalPresentationStyle = .custom
modal.code = self.tourCodeTextField.text!.trimmingCharacters(in: .whitespaces)
SPStorkController.updatePresentingController(modal: modal)

And I'm getting an error Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value, that routes to SPStorkPresentationController.swift, 541 line. Is that a problem with nibs or I've done smth wrong?

ivanvorobei commented 5 years ago

You try update controller before presenting. It incorrect.