Re: Accessibility UIContentSizeCategory or current accessibility font setting
Re: Accessibility UIContentSizeCategory or current accessibility font setting
- Subject: Re: Accessibility UIContentSizeCategory or current accessibility font setting
- From: David Duncan via Cocoa-dev <email@hidden>
- Date: Mon, 18 Oct 2021 09:31:38 -0700
In general its also preferred that you look at the traitCollection of the most
relevant view for this information – there are contexts for which the content
size category may not match the global value (and there is API on UIView to
restrict the overall range that you can apply as well). This also means you can
just use traitCollectionDidChange as your notification.
> On Oct 17, 2021, at 12:50 PM, Matt Jacobson via Cocoa-dev
> <email@hidden> wrote:
>
> Hey Alex,
>
>> On Oct 17, 2021, at 2:51 PM, Alex Zavatone via Cocoa-dev
>> <email@hidden> wrote:
>>
>> We’ve got a situation where we need to check the current accessibility font
>> size enum and apply custom settings to some attributed fonts. I’ve seen
>> that there is a way to check the current dynamic text size using SwiftUI,
>> but I haven’t seen how to do it using UIKit.
>>
>> I’ve seen that UIContentSizeCategory exists, but no idea how to see what the
>> current value is.
>>
>> Is anyone aware how to do this? TIA.
>
> Have you tried this?
>
> [UIApp preferredContentSizeCategory]
>
> (Don’t forget to observe changes: UIContentSizeCategoryDidChangeNotification.)
>
> Matt
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden