crash here line 89<<< drAction.didSelect{(selectedText , index , id) in
//update and return
if selectedText == "Bought" {
self.action = "B"
} else if selectedText == "Sold" {
self.action = "S"
if let s = UserDefaults.standard.string(forKey: "tip_sold"), s == "Y" {
Please help, how can I protect against this type of crash?
Crash log: Crashed: com.apple.main-thread 0 myapp 0x10292ac14 GetStartedQuickVC.viewDidLoad() + 89 (GetStartedQuickVC.swift:89) 1 myapp 0x10292b2a0 @objc GetStartedQuickVC.viewDidLoad() + 4297503392 (:4297503392)
2 UIKitCore 0x18b478658 -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 100
3 UIKitCore 0x18b47d0e8 -[UIViewController loadViewIfRequired] + 936
4 UIKitCore 0x18b47d4f0 -[UIViewController view] + 28
5 UIKitCore 0x18b492b6c -[UIViewController _setPresentationController:] + 108
6 UIKitCore 0x18b48b95c -[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1344
7 UIKitCore 0x18b48d358 -[UIViewController _presentViewController:withAnimationController:completion:] + 4228
8 UIKitCore 0x18b48f864 __63-[UIViewController _presentViewController:animated:completion:]_block_invoke + 104
9 UIKitCore 0x18b48fd6c -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 508
10 UIKitCore 0x18b48f7b4 -[UIViewController presentViewController:animated:completion:] + 196
11 UIKitCore 0x18b48fa20 -[UIViewController presentViewController:animated:completion:] + 164
12 myapp 0x1028eaf00 GetStartedVC.onQuickUpdate(:) + 369 (GetStartedVC.swift:369)
13 myapp 0x1028f9408 @objc GetStartedVC.onClose(_:) + 4297298952
14 UIKitCore 0x18bac172c -[UIApplication sendAction:to:from:forEvent:] + 96
15 UIKitCore 0x18b4d1ed0 -[UIControl sendAction:to:forEvent:] + 240
16 UIKitCore 0x18b4d2228 -[UIControl _sendActionsForEvents:withEvent:] + 396
17 UIKitCore 0x18b4d124c -[UIControl touchesEnded:withEvent:] + 516
18 UIKitCore 0x18b692f24 _UIGestureEnvironmentUpdate + 7088
19 UIKitCore 0x18b691328 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 372
20 UIKitCore 0x18b6910f4 -[UIGestureEnvironment _updateForEvent:window:] + 232
21 UIKitCore 0x18bafcc48 -[UIWindow sendEvent:] + 3440
22 UIKitCore 0x18bad88ec -[UIApplication sendEvent:] + 344
23 UIKitCore 0x18bb59970 dispatchPreprocessedEventFromEventQueue + 6808
24 UIKitCore 0x18bb5c4ec handleEventQueueInternal + 5364
25 UIKitCore 0x18bb54168 handleHIDEventFetcherDrain + 140
26 CoreFoundation 0x18798aad8 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24
27 CoreFoundation 0x18798aa30 CFRunLoopDoSource0 + 80
28 CoreFoundation 0x18798a1b8 CFRunLoopDoSources0 + 184
29 CoreFoundation 0x1879851e8 CFRunLoopRun + 788
30 CoreFoundation 0x187984ba8 CFRunLoopRunSpecific + 424
31 GraphicsServices 0x191afb344 GSEventRunModal + 160
32 UIKitCore 0x18bac03e4 UIApplicationMain + 1932
33 myapp 0x10271626c main + 24 (DivChangesVC.swift:24)
34 libdyld.dylib 0x18780c8f0 start + 4