{"id":3158,"date":"2023-06-08T10:45:40","date_gmt":"2023-06-08T14:45:40","guid":{"rendered":"https:\/\/michaelrowe01.com\/?p=3158"},"modified":"2023-06-08T10:45:43","modified_gmt":"2023-06-08T14:45:43","slug":"meet-swiftui-for-spatial-computing","status":"publish","type":"post","link":"https:\/\/michaelrowe01.com\/index.php\/blog\/meet-swiftui-for-spatial-computing\/","title":{"rendered":"Meet SwiftUI for Spatial Computing\u00a0"},"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=\"3159\" data-permalink=\"https:\/\/michaelrowe01.com\/index.php\/blog\/meet-swiftui-for-spatial-computing\/attachment\/andrew-richardson-swiftui-engineer\/\" data-orig-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Andrew-Richardson-SwiftUI-Engineer.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=\"Andrew-Richardson-SwiftUI-Engineer\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Andrew-Richardson-SwiftUI-Engineer.png?fit=660%2C371&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Andrew-Richardson-SwiftUI-Engineer-1024x576.png?resize=660%2C371&#038;ssl=1\" alt=\"\" class=\"wp-image-3159\" srcset=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Andrew-Richardson-SwiftUI-Engineer.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Andrew-Richardson-SwiftUI-Engineer.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Andrew-Richardson-SwiftUI-Engineer.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Andrew-Richardson-SwiftUI-Engineer.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Andrew-Richardson-SwiftUI-Engineer.png?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Andrew-Richardson-SwiftUI-Engineer.png?w=1320&amp;ssl=1 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This is a high-level review of SwiftUI\u2019s extensions for xrOS&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">All of xrOS was built in SwiftUI<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Buttons can provide audio feedback when pressed.&nbsp; With Spatial computing we have to use Scenes, see the three types defined in other sessions &#8211; Window, Volume, and Full Space.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Breaking down the structure of a windows<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Start with glass background<\/li>\n\n\n\n<li>Within that you have same navigation containers &#8211; like TabView, and SplitView with Navigation and Lists<\/li>\n\n\n\n<li>Using labels for tabs, they will be exposed when hovered.<\/li>\n\n\n\n<li>Ornaments are new &#8211; and provide an overlay on the bottom edge of a window (with slight overlap)<\/li>\n\n\n\n<li>You should use various Material treatments to the background of windows &#8211; this will then dynamically adjust base on the background etc.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Interactions<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Eyes, by looking<\/li>\n\n\n\n<li>Hands, reach out to touch<\/li>\n\n\n\n<li>Pointer, connected track pad keyboard, etc.<\/li>\n\n\n\n<li>Accessibility, supports all the controls from other platforms<\/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=\"3160\" data-permalink=\"https:\/\/michaelrowe01.com\/index.php\/blog\/meet-swiftui-for-spatial-computing\/attachment\/swiftul-gestures-tapgesture-spatialtapgesture-1-1\/\" data-orig-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftUl-gestures-TapGesture-SpatialTapGesture-1-1.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=\"SwiftUl-gestures-TapGesture-SpatialTapGesture-1-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftUl-gestures-TapGesture-SpatialTapGesture-1-1.png?fit=660%2C371&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftUl-gestures-TapGesture-SpatialTapGesture-1-1.png?resize=660%2C371&#038;ssl=1\" alt=\"\" class=\"wp-image-3160\" srcset=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftUl-gestures-TapGesture-SpatialTapGesture-1-1.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftUl-gestures-TapGesture-SpatialTapGesture-1-1.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftUl-gestures-TapGesture-SpatialTapGesture-1-1.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftUl-gestures-TapGesture-SpatialTapGesture-1-1.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftUl-gestures-TapGesture-SpatialTapGesture-1-1.png?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftUl-gestures-TapGesture-SpatialTapGesture-1-1.png?w=1320&amp;ssl=1 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Hover effects:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Critical to make your app responsive and assist with targeting<\/li>\n\n\n\n<li>Added automatically to most controls.\u00a0 If you create your own custom controller style, you want to add this\n<ul class=\"wp-block-list\">\n<li>I will have to correct my custom button style in Wasted Time<\/li>\n\n\n\n<li>Just add .hoverEffect() to your button style<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Elevate your windowed app for Spatial computing (session to watch)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Volumes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Just change .windowStyle(.volumetric) and you can set a .defaultSize(<\/li>\n\n\n\n<li>Model3D is similar to image but always loads async &#8211; and it is also just another SwiftUI View<\/li>\n\n\n\n<li>If you add a ZStack around a Model3D &#8211; it will be aware of the content space and depth.<\/li>\n\n\n\n<li>You can add .padding3D(.front, 200)<\/li>\n\n\n\n<li>You can also use .glassBackgroundEffect(in:<\/li>\n\n\n\n<li>You can add .rotation3DEffect(rotation, axis: .y)<\/li>\n\n\n\n<li>You can use RealityView to provide full access to RealityKit content&nbsp;<\/li>\n\n\n\n<li>Check out \u201cBuild Spatial experience with RealityKit\u201d<\/li>\n\n\n\n<li>Gestures and attachments are enabled with RealityView<\/li>\n\n\n\n<li>\u201cTake SwiftUI to the next Dimension\u201d<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Full Spaces:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Gives you full control of the environment.<\/li>\n\n\n\n<li>Just add ImmersiveSpace(id: ) { View() }&nbsp;<\/li>\n\n\n\n<li>You can adjust immersion styles and transition between them on the style.&nbsp; Mixed, Full, and Progressive (middle ground)<\/li>\n\n\n\n<li>You can use ARKit to make your space even more interactive and use physics with the real world.<\/li>\n\n\n\n<li>There\u2019s a deep dive in <strong>Go Beyond the Window with SwiftUI<\/strong><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This is a high-level review of SwiftUI\u2019s extensions for xrOS&nbsp; All of xrOS was built in SwiftUI Buttons can provide audio feedback when pressed.&nbsp; With Spatial computing we have to use Scenes, see the three types defined in other sessions &#8211; Window, Volume, and Full Space.&nbsp; Breaking down the structure of a windows Interactions Hover [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_wp_convertkit_post_meta":{"form":"-1","landing_page":"0","tag":"0","restrict_content":"0"},"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},"jetpack_post_was_ever_published":false},"categories":[2,3],"tags":[703,527,680],"class_list":["post-3158","post","type-post","status-publish","format-standard","hentry","category-blog","category-personal-softwareandit","tag-spatial-computing","tag-swiftui","tag-wwdc23"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2aMa8-OW","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3158","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=3158"}],"version-history":[{"count":1,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3158\/revisions"}],"predecessor-version":[{"id":3161,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3158\/revisions\/3161"}],"wp:attachment":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/media?parent=3158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/categories?post=3158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/tags?post=3158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}