You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rive, for some reason, crashed (SIGABRT (ABORT)) several times during runtime before showing the animation when used in UIBarButtonItem.
Simplified code
// View and VM, which are used as a container for RiveView to change visibility
// final class AnimatedViewModel: RiveViewModel { ... }
finalclassAnimatedView:UIView{varviewModel:AnimatedViewModel?{
didSet {
viewModel?.setView(riveView)
viewModel.configureStateChangeAction{[weak self] isHidden inself?.riveView.isHidden = isHidden
}}}privateletriveView=RiveView()init(){
super.init(frame:.zero)addSubview(riveView)
riveView.translatesAutoresizingMaskIntoConstraints =false
riveView.topAnchor.constraint(equalTo: topAnchor).isActive =true
riveView.bottomAnchor.constraint(equalTo: bottomAnchor).isActive =true
riveView.leftAnchor.constraint(equalTo: leftAnchor).isActive =true
riveView.rightAnchor.constraint(equalTo: rightAnchor).isActive =true}requiredinit?(coder:NSCoder){fatalError("init(coder:) has not been implemented")}}
// Custom UIBarButtonItem for adding AnimatedView and interactions with it
finalclassAnimatedBarButtonItem:UIBarButtonItem{varviewModel:AnimatedBarButtonItemViewModel?{
didSet {
animatedView.viewModel = viewModel?.animatedViewModel
viewModel.configure(tapRecognizer: tapRecognizer)
viewModel?.configureTapRecognizerAvailabilityAction{[weak self] isEnabled inself?.tapRecognizer.isEnabled = isEnabled
}}}privateletanimatedView=AnimatedView()privatelettapRecognizer=UITapGestureRecognizer()overridepublicinit(){
super.init()
animatedView.addGestureRecognizer(tapRecognizer)
customView = animatedView
customView?.translatesAutoresizingMaskIntoConstraints =false
customView?.widthAnchor.constraint(equalToConstant:60).isActive =true
customView?.heightAnchor.constraint(equalToConstant:50).isActive =true}requiredinit?(coder aDecoder:NSCoder){fatalError("init(coder:) has not been implemented")}}
// Add this button to the navbar in VC
finalclassMainViewController:UIViewController{...func configureNavigationBar(){
navigationItem.rightBarButtonItems =[AnimatedBarButtonItem()]}}
Hello!
Description
Rive, for some reason, crashed (SIGABRT (ABORT)) several times during runtime before showing the animation when used in
UIBarButtonItem
.Simplified code
Crash Report
Crashed: Thread #1
SIGABRT ABORT 0x00000001db4e12d4
Expected behavior
The application should not crash.
Device & Versions (please complete the following information)
Additional context
The crash is very rare, but it appears from time to time and only on real devices, and the reason is still unclear.
The text was updated successfully, but these errors were encountered: