Unable to observe UIAlertController `isBeingDismissed` property.

Originator:digendra.rajak
Number:rdar://FB7603561 Date Originated:02/27/2020
Status:Open Resolved:
Product:Foundation Kit Product Version:
Classification: Reproducible:YES
 
UIAlertController is a subclass of UIViewController. Any property inherited from NSObject is obseveable. UIViewController has a property called isBeingDismissed. We created an observer 
on UIAlertController for a property isBeingDismissed and we are unable to observe. However we could able to observe the property on `title` and `message`, `isBeingDismissed` super class property.
Additionally docs avoids subclassing UIAlertController to add any other property or completion handler for alert dismissal.

Code snippet:

Uable to (KVO) observe on isBeingDismissed
self.alertController?.addObserver(self, forKeyPath:#keyPath(UIAlertController.isBeingDismissed), options: .new, context: nil);

Able to (KVO) on isBeingDismissed with options .initial
self.alertController?.addObserver(self, forKeyPath:#keyPath(UIAlertController.isBeingDismissed), options: .initial, context: nil);

Able to observe with title property
self.alertController?.addObserver(self, forKeyPath:"title", options: .new, context: nil);

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!