Post

Replies

Boosts

Views

Activity

Is there a way to find the error code of network errors from their localizedDescriptions?
There are several network errors being logged. Only the description is being logged now. Is there some way of finding out the exact reason for these errors. Eg. I have some logs that state: A data connection is not currently allowed. I am unable to find the code for this and don't understand the reason for the above issue.
2
0
649
Oct ’23
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
1.1k
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
994
Oct ’22