UIBarButtonItem accessibilityLabel should be configurable in IB

Originator:futuretap
Number:rdar://28493092 Date Originated:27-Sep-2016 01:14 PM
Status:Open Resolved:
Product:iOS SDK Product Version:10.1 beta 1
Classification:UI/Usability Reproducible:Always
 
There's currently no way to specify the accessibilityLabel of UIBarButtonItem in IB.

I tried setting `accessibilityLabel` as a User Defined Runtime Attribute with type `Localized String`. Xcode correctly adds the localized string to the xxx.strings file but iOS fails to localize the accessibilityLabel according to the provided translation.


Note:
I created an ugly workaround by swizzling -[UIBarButtonItem  awakeFromNib] but this is such a basic and essential feature this should really not be needed!

- (void)myAwakeFromNib {
	[self myAwakeFromNib];
	
	if (self.accessibilityLabel.length) {
		self.accessibilityLabel = [[NSBundle mainBundle] localizedStringForKey:self.accessibilityLabel value:self.accessibilityLabel table: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!