-
-
Notifications
You must be signed in to change notification settings - Fork 538
Closed
Description
Description
Hi. In our company, we use FloatingPanel and our users experience a crash in Transitioning.swift:122
func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
guard
let fpc = transitionContext?.viewController(forKey: .from) as? FloatingPanelController
else { fatalError()} // here
let animator = fpc.animatorForDismissing(with: .zero)
return TimeInterval(animator.duration)
}Unfortunately, we cannot catch this bug and understand what is happening. We have tried to reproduce it in various ways.
I would like to ask two questions:
- Why do you call fatalError()? It seems to me too dangerous to use fatal Error in production :(
- Is it possible to remove fatalError() and return, for example, 0.0?
I would appreciate your prompt response. 🙏
Expected behavior
- Do not crash the application, but return some value/error.
Actual behavior
- The application crashes.
Environment
Library version
- 2.5.5
Installation method
- Swift Package Manager
iOS version(s)
- Any
Xcode version
- 15.10.0
Metadata
Metadata
Assignees
Labels
No labels