Try this:
guard let transitionContainerView = self.transitionContext?.containerView else {
print("the containerView of transitionContext is nil. Find out why.")
return
}
You might need to cast the transitionContainerView object with a specific type. I don't know what the type is supposed to be but it would look something like this:
guard let transitionContainerView = self.transitionContext?.containerView as? MyValueType else {
print("the containerView of transitionContext is nil. Find out why.")
return
}
The addition here is the as? MyValueType portion
If you don't hit the code block within the else statement, then it is not nil and you should be able to use your object accordingly. I hope this helps!