fix: Add iOS 16+ availability check for attributedTitle (#165)

This commit is contained in:
Mustafa Uysal 2025-09-15 17:07:30 +03:00 committed by GitHub
parent 507e8aa7c1
commit c16d193e9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -270,8 +270,8 @@
actionMenuItem.state =
action.selected ? UIMenuElementStateOn : UIMenuElementStateOff;
// Apply titleColor using attributedTitle
if (titleColor != nil) {
// Apply titleColor using attributedTitle (iOS 16+ only)
if (titleColor != nil && @available(iOS 16.0, *)) {
NSDictionary *attributes = @{NSForegroundColorAttributeName: titleColor};
NSAttributedString *attributedTitle = [[NSAttributedString alloc] initWithString:action.title attributes:attributes];
[actionMenuItem setValue:attributedTitle forKey:@"attributedTitle"];