{"id":44649,"date":"2024-08-27T21:02:09","date_gmt":"2024-08-28T01:02:09","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=44649"},"modified":"2024-08-27T21:02:09","modified_gmt":"2024-08-28T01:02:09","slug":"migrating-keyboardkit-to-swift-6-language-mode","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2024\/08\/27\/migrating-keyboardkit-to-swift-6-language-mode\/","title":{"rendered":"Migrating KeyboardKit to Swift 6 Language Mode"},"content":{"rendered":"<p><a href=\"https:\/\/douglashill.co\/keyboardkit-swift-6\/\">Douglas Hill<\/a> (<a href=\"https:\/\/x.com\/qdoug\/status\/1822616585887994309\">tweet<\/a>):<\/p>\n<blockquote cite=\"https:\/\/douglashill.co\/keyboardkit-swift-6\/\"><p>Over the weekend, I updated <a href=\"https:\/\/github.com\/douglashill\/KeyboardKit\">KeyboardKit<\/a> to full data race safety with Swift 6 language mode. KeyboardKit is my open source framework that&lsquo;s the easiest way to add comprehensive hardware keyboard control to an iPad, iPhone, or Mac Catalyst app.<\/p><p>This is a great test case because KeyboardKit is a small UI framework that doesn&rsquo;t perform any slow operations, so all its code is intended to be run on the main thread. It should be trivial to opt into strict concurrency. I didn&rsquo;t want to spent more than about an hour on this.<\/p><p>Many issues were resolved simply by annotating types with <code>@MainActor<\/code>, but I wanted to share three interesting situations that came up in the migration, two of which seem like issues on Apple&rsquo;s side.<\/p>\n<p>[&#8230;]<\/p>\n<p>No data race safety issues were exposed.<\/p><\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2024\/07\/22\/swift-6-announced\/\">Swift 6 Announced<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Douglas Hill (tweet): Over the weekend, I updated KeyboardKit to full data race safety with Swift 6 language mode. KeyboardKit is my open source framework that&lsquo;s the easiest way to add comprehensive hardware keyboard control to an iPad, iPhone, or Mac Catalyst app.This is a great test case because KeyboardKit is a small UI framework [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2024-08-28T01:02:11Z","apple_news_api_id":"8aa847b2-a302-4916-ab83-33a0db6fd885","apple_news_api_modified_at":"2024-08-28T01:02:12Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AiqhHsqMCSRargzOg22_YhQ","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[69,31,2586,74,71,2200,901],"class_list":["post-44649","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-ios","tag-ios-18","tag-opensource","tag-programming","tag-swift-concurrency","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/44649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=44649"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/44649\/revisions"}],"predecessor-version":[{"id":44650,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/44649\/revisions\/44650"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=44649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=44649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=44649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}