Post

Replies

Boosts

Views

Activity

Catch crash occurences and store to user defaults
Is there a way to catch the crashes from both swift and obj-c without using any 3rd party libraries? I want a way to note that my app has crashed, no stack trace needed just want some count of crashes stored to user defaults. I saw NSSetUncaughtExceptionHandler being used but it is only catching obj-c related errors. eg. force unwrapping nil is not caught here. I want a universal way of catching the crashes. also want to know if this can affect the crash reporting by 3rd party libraries
2
0
595
Aug ’23
overriding UINavigationItem of a UIViewController broken for iOS16.
On overriding UINavigationItem of a UIViewController, the left and right UIBarButtonItems don't appear in iOS16 . The same code works for iOS16 and below. In the snippet below if VC is presented the left bar items don't show up. class VC:UIViewController {   override var navigationItem: UINavigationItem {     get {       return NavItem()     } set {     }   } } class NavItem: UINavigationItem {   override var leftBarButtonItems: [UIBarButtonItem]? {     get {       let view2 = UIView.init(frame: CGRect.init(x: 3, y: 3, width: 40, height: 40))       view2.backgroundColor = .gray       return [UIBarButtonItem.init(customView: view2)]     } set {             }   }       override var titleView: UIView? {     get {       let view2 = UIView.init(frame: CGRect.init(x: 3, y: 3, width: 40, height: 40))       view2.backgroundColor = .systemRed       return view2     } set {             }   } }
3
0
805
Oct ’22