SafariExtensions
SafariExtensions copied to clipboard
FB11664965 - SFSafariExtensionHandling validateToolbarItemInWindow:validationHandler: incorrect nullability annotation
In the SFSafariExtensionHandling.h header, the method - (void)validateToolbarItemInWindow:(SFSafariWindow *)window validationHandler:(void (^)(BOOL enabled, NSString *badgeText))validationHandler;
annotates the badgeText parameter as nonnull, because of NS_ASSUME_NONNULL_BEGIN. However, I believe that it should be annotated as nullable. https://developer.apple.com/documentation/safariservices/sfsafariextensionhandling/1639492-validatetoolbariteminwindow?language=objc At runtime, the validate handler successfully takes nil as an argument, and the method SFSafariToolbarItem setBadgeText: has the documentation "Pass nil to remove the badge." https://developer.apple.com/documentation/safariservices/sfsafaritoolbaritem/2823945-setbadgetext?language=objc