{"id":45267,"date":"2024-10-07T13:27:30","date_gmt":"2024-10-07T17:27:30","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=45267"},"modified":"2024-10-24T14:17:17","modified_gmt":"2024-10-24T18:17:17","slug":"xcode-16-folders-and-groups","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2024\/10\/07\/xcode-16-folders-and-groups\/","title":{"rendered":"Xcode 16 Folders and Groups"},"content":{"rendered":"<p><a href=\"https:\/\/troz.net\/post\/2024\/xcode_folders_groups\/\">Sarah Reichelt<\/a> (<a href=\"https:\/\/mastodon.social\/@troz\/113150963747775846\">Mastodon<\/a>):<\/p>\n<blockquote cite=\"https:\/\/troz.net\/post\/2024\/xcode_folders_groups\/\">\n<p>In Xcode 16, project files and folders are arranged differently in the Project navigator. What used to be a <strong>group<\/strong> is now a <strong>folder<\/strong>, and this simple change has some interesting effects. At first, I was against the new scheme - in fact in my <a href=\"https:\/\/troz.net\/post\/2024\/swiftui-mac-2024\/\">SwiftUI for Mac 2024<\/a>\narticle, I specifically recommended reverting back to the old group method. But after doing some more reading and testing, I think the answer is not so clear cut.<\/p>\n<p>[&#8230;]<\/p>\n<p>At a first glance, there are two differences: the order of the files &amp; folders and the color of the folder icons. A less obvious difference is that in Xcode 15, I can drag files around to arrange them in the order I prefer. In Xcode 16, I can&rsquo;t do that. I can drag files into or out of folders, but I can&rsquo;t move them around at the same level.<\/p>\n<p>[&#8230;]<\/p>\n<p>This points out the fundamental difference between the two approaches: <strong>groups<\/strong> are an artificial construct that is stored in the project files. Usually, this mirrors the file and folder structure in Finder, but it doesn&rsquo;t have to. When you use <strong>folders<\/strong>, Xcode is reading the file and folder structure directly from the Finder.<\/p>\n<p>[&#8230;]<\/p>\n<p>The big difference is in source control, especially if you&rsquo;re working with other people. When every file addition, deletion or move also changes the project file, you have a much greater chance of getting a merge conflict.<\/p>\n<\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2024\/09\/12\/xcode-16\/\">Xcode 16<\/a><\/li>\n<\/ul>\n\n<p id=\"xcode-16-folders-and-groups-update-2024-10-24\">Update (2024-10-24): <a href=\"https:\/\/dimillian.medium.com\/why-you-should-use-xcode-16-buildable-folders-instead-of-groups-6f438611914d\">Thomas Ricouard<\/a>:<\/p>\n<blockquote cite=\"https:\/\/dimillian.medium.com\/why-you-should-use-xcode-16-buildable-folders-instead-of-groups-6f438611914d\">\n<p>I&rsquo;ve recently migrated Ice Cubes, my open-source SwiftUI Mastodon client to use file system folders instead of Xcode groups.<\/p>\n<p>[&#8230;]<\/p>\n<p>Folders have many advantages over Xcode virtual groups, so I think it&rsquo;s worth enumerating them in an article so you can get the gist of it.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Sarah Reichelt (Mastodon): In Xcode 16, project files and folders are arranged differently in the Project navigator. What used to be a group is now a folder, and this simple change has some interesting effects. At first, I was against the new scheme - in fact in my SwiftUI for Mac 2024 article, I specifically [&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-10-07T17:27:32Z","apple_news_api_id":"b1a0eba5-2c7c-426a-b67c-be0e5ed9d7a4","apple_news_api_modified_at":"2024-10-24T18:17:20Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/AsaDrpSx8Qmq2fL4OXtnXpA","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,2598,71,376,226],"class_list":["post-45267","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-mac","tag-macos-15-sequoia","tag-programming","tag-versioncontrol","tag-xcode"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/45267","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=45267"}],"version-history":[{"count":3,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/45267\/revisions"}],"predecessor-version":[{"id":45497,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/45267\/revisions\/45497"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=45267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=45267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=45267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}