{"id":29492,"date":"2020-07-14T17:01:45","date_gmt":"2020-07-14T21:01:45","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=29492"},"modified":"2020-07-14T17:01:45","modified_gmt":"2020-07-14T21:01:45","slug":"swiftui-for-mac-on-big-sur","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2020\/07\/14\/swiftui-for-mac-on-big-sur\/","title":{"rendered":"SwiftUI for Mac on Big Sur"},"content":{"rendered":"<p><a href=\"https:\/\/troz.net\/post\/2020\/swiftui_mac_big_sur\/\">Sarah Reichelt<\/a>:<\/p>\n<blockquote cite=\"https:\/\/troz.net\/post\/2020\/swiftui_mac_big_sur\/\">\n<p>After a lot of testing, several days of frustration and help from <a href=\"https:\/\/twitter.com\/jsngr\">Jordan Singer<\/a> with his <a href=\"https:\/\/github.com\/jordansinger\/mail-swiftui-sample\">mail-swiftui-sample<\/a> project, I was finally able to work this out. The difference is that the initial view has to specify what comes next as well as what it is displaying.<\/p>\n<p>[&#8230;]<\/p>\n<p>In the old style SwiftUI apps which were wrapped in AppKit, the menus were in a storyboard that you could edit. Now you add <code>commands<\/code> to the app&rsquo;s <code>WindowGroup<\/code> to alter the menus.<\/p>\n<p>[&#8230;]<\/p>\n<p>With menus and toolbars, there is a heap of extra code added to certain views. I would love to be able to extract that into its own function or view modifier. I was able to extract the toolbar, but I am not sure how to do this with menus yet.<\/p>\n<\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2020\/07\/13\/implicit-capturing-of-self-in-swift-5-3\/\">Implicit Capturing of Self in Swift 5.3<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2020\/07\/02\/a-huge-year-for-swiftui\/\">A Huge Year for SwiftUI<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2020\/01\/31\/swiftui-for-mac\/\">SwiftUI for Mac<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Sarah Reichelt: After a lot of testing, several days of frustration and help from Jordan Singer with his mail-swiftui-sample project, I was finally able to work this out. The difference is that the initial view has to specify what comes next as well as what it is displaying. [&#8230;] In the old style SwiftUI apps [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2020-07-14T21:01:48Z","apple_news_api_id":"f7d958ec-f766-48fd-a40e-f4ce7d52a998","apple_news_api_modified_at":"2020-07-14T21:01:49Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/A99lY7PdmSP2kDvTOfVKpmA","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":[30,1891,71,1812],"class_list":["post-29492","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-mac","tag-macos-11-0","tag-programming","tag-swiftui"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/29492","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=29492"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/29492\/revisions"}],"predecessor-version":[{"id":29493,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/29492\/revisions\/29493"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=29492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=29492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=29492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}