Skip to content

fix(iOS): crash on reload #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ios/TrueSheetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {

private var isPresented = false
private var activeIndex: Int?
private var bridge: RCTBridge
private var bridge: RCTBridge?
private var touchHandler: RCTTouchHandler
private var viewController: TrueSheetViewController

Expand Down Expand Up @@ -143,7 +143,7 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
guard let containerView else { return }

let size = CGSize(width: width, height: containerView.bounds.height)
bridge.uiManager.setSize(size, for: containerView)
bridge?.uiManager.setSize(size, for: containerView)
}

func viewControllerWillAppear() {
Expand Down Expand Up @@ -297,7 +297,7 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {

@objc
func setScrollableHandle(_ tag: NSNumber?) {
let view = bridge.uiManager.view(forReactTag: tag) as? RCTScrollView
let view = bridge?.uiManager.view(forReactTag: tag) as? RCTScrollView
rctScrollView = view
}

Expand Down