{"id":3168,"date":"2023-06-08T12:02:32","date_gmt":"2023-06-08T16:02:32","guid":{"rendered":"https:\/\/michaelrowe01.com\/?p=3168"},"modified":"2023-06-08T12:02:34","modified_gmt":"2023-06-08T16:02:34","slug":"build-accessible-apps-with-swiftui-and-uikit","status":"publish","type":"post","link":"https:\/\/michaelrowe01.com\/index.php\/blog\/build-accessible-apps-with-swiftui-and-uikit\/","title":{"rendered":"Build accessible apps with SwiftUI and UIKit"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"371\" data-attachment-id=\"3170\" data-permalink=\"https:\/\/michaelrowe01.com\/index.php\/blog\/build-accessible-apps-with-swiftui-and-uikit\/attachment\/build-accessible-apps\/\" data-orig-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Build-accessible-apps.png?fit=1920%2C1080&amp;ssl=1\" data-orig-size=\"1920,1080\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Build-accessible-apps\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Build-accessible-apps.png?fit=660%2C371&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Build-accessible-apps.png?resize=660%2C371&#038;ssl=1\" alt=\"\" class=\"wp-image-3170\" srcset=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Build-accessible-apps.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Build-accessible-apps.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Build-accessible-apps.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Build-accessible-apps.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Build-accessible-apps.png?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Build-accessible-apps.png?w=1320&amp;ssl=1 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<p>Accessibility is key for Apple.&nbsp; I agree with this philosophy, having even written an article years ago for the magazine called \u201cEnabled\u201d on how OS\/2 was made accessible.&nbsp; I loved that the magazine was called \u201cEnabled\u201d instead of \u201cDisabled\u201d as it sent a message to the reader that they were not less than.<\/p>\n\n\n\n<p>Accessibility Enhancements<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Adding hints via .accessibilityAddTraits(.isToggle) lets the system know that this button has a toggle trait to provide proper hint and switch button information\n<ul class=\"wp-block-list\">\n<li>Also available in UIKit<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>You can add new announcements to do things like let user know screen is loading\n<ul class=\"wp-block-list\">\n<li>Accessibility Notifications &#8211; can be created for \u201cAnnouncement\u201d, \u201cLayoutChanged\u2019, \u201cScreenChanged\u201d, and \u201cPageScrolled\u201d messages to assistive devices, etc,<\/li>\n\n\n\n<li>The API is pretty simple &#8211; `AccessibilityNotification.Announcement(\u201cTEXT\u201d).post()`<\/li>\n\n\n\n<li>You can set announcement priority so they don\u2019t overlap and cut each other off, if there are a series of announcements going in sequence.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"371\" data-attachment-id=\"3169\" data-permalink=\"https:\/\/michaelrowe01.com\/index.php\/blog\/build-accessible-apps-with-swiftui-and-uikit\/attachment\/announcement-priority\/\" data-orig-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Announcement-priority.png?fit=1920%2C1080&amp;ssl=1\" data-orig-size=\"1920,1080\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Announcement-priority\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Announcement-priority.png?fit=660%2C371&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Announcement-priority.png?resize=660%2C371&#038;ssl=1\" alt=\"\" class=\"wp-image-3169\" srcset=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Announcement-priority.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Announcement-priority.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Announcement-priority.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Announcement-priority.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Announcement-priority.png?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Announcement-priority.png?w=1320&amp;ssl=1 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Accessibility Zoom Action .accessibilityZoomAction modifier allows for zooming via voice over.<\/li>\n\n\n\n<li>.allowsDirectInteraction trait allows you to define a region of the screen for direct interaction with your app, you can bypass voice over &#8211; you can .silentOnTouch and .requiresActivation as options<\/li>\n<\/ul>\n\n\n\n<p>Improve Accessibility Visual<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>.contentShape(.accessibility, type) &#8211; to control accessibility actions on the screen.&nbsp; You can create custom cursor visuals, you can apply this to a view and<\/li>\n<\/ul>\n\n\n\n<p>Keep state up-to-date<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Block based attribute setters is coming<\/li>\n\n\n\n<li>You can now keep underlying attributes up to date. This provides a closure for attributes (whenever it is needed). It is reevaluated whenever it is accessed by assistive technology.<\/li>\n\n\n\n<li>It must return the correct type, this makes it easier to maintain the elements.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Accessibility is key for Apple.&nbsp; I agree with this philosophy, having even written an article years ago for the magazine called \u201cEnabled\u201d on how OS\/2 was made accessible.&nbsp; I loved that the magazine was called \u201cEnabled\u201d instead of \u201cDisabled\u201d as it sent a message to the reader that they were not less than. Accessibility Enhancements [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"hide_page_title":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2,3],"tags":[714,109,527,715,680],"class_list":["post-3168","post","type-post","status-publish","format-standard","hentry","category-blog","category-personal-softwareandit","tag-accessibility","tag-day-4","tag-swiftui","tag-uikit","tag-wwdc23"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2aMa8-P6","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/comments?post=3168"}],"version-history":[{"count":1,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3168\/revisions"}],"predecessor-version":[{"id":3171,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3168\/revisions\/3171"}],"wp:attachment":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/media?parent=3168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/categories?post=3168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/tags?post=3168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}