{"id":3033,"date":"2023-06-06T21:10:55","date_gmt":"2023-06-07T01:10:55","guid":{"rendered":"https:\/\/michaelrowe01.com\/?p=3033"},"modified":"2023-06-08T09:10:09","modified_gmt":"2023-06-08T13:10:09","slug":"whats-new-in-swiftui","status":"publish","type":"post","link":"https:\/\/michaelrowe01.com\/index.php\/blog\/whats-new-in-swiftui\/","title":{"rendered":"What\u2019s new in SwiftUI"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"408\" data-attachment-id=\"3077\" data-permalink=\"https:\/\/michaelrowe01.com\/index.php\/blog\/whats-new-in-swiftui\/attachment\/%ef%a3%bfwwdc23-3\/\" data-orig-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-3.png?fit=1707%2C1056&amp;ssl=1\" data-orig-size=\"1707,1056\" 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=\"\uf8ffWWDC23-3\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-3.png?fit=660%2C408&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-3.png?resize=660%2C408&#038;ssl=1\" alt=\"\" class=\"wp-image-3077\" srcset=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-3.png?resize=1024%2C633&amp;ssl=1 1024w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-3.png?resize=300%2C186&amp;ssl=1 300w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-3.png?resize=768%2C475&amp;ssl=1 768w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-3.png?resize=1536%2C950&amp;ssl=1 1536w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-3.png?w=1707&amp;ssl=1 1707w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-3.png?w=1320&amp;ssl=1 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<p>SwiftUI in more places<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Containers have been updated to address VisionOS &#8211; you can add .volumetric to a WindowView<\/li>\n\n\n\n<li>RealityView<\/li>\n\n\n\n<li>ImmersiveSpace {} Scene type allows for full emersion or mixed to create a AR view<\/li>\n\n\n\n<li>Redesigned UX on watchOS 10, is based on existing SwiftUI views.&nbsp; Get new transitions\n<ul class=\"wp-block-list\">\n<li>.containerBackground modifier will allow for transitions in push and pop<\/li>\n\n\n\n<li>ToolbarItem(placement: .topBarTrailing and .bottomBar}<\/li>\n\n\n\n<li>Date Picker and Selection in List have been added to Apple Watch<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Widgets on iPad, Home Screen, Desktop, and interactive controls<\/li>\n\n\n\n<li>New framework updates for SwiftUI &#8211; Focus on major updates to MapKit &#8211; (will need to see how I can reformat my Map integrations &#8211; Meet MapKit for SwiftUI), ChartKit has scrolling charts, donuts, and pie charts.<\/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=\"369\" data-attachment-id=\"3078\" data-permalink=\"https:\/\/michaelrowe01.com\/index.php\/blog\/whats-new-in-swiftui\/attachment\/swiftdata\/\" data-orig-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftData.png?fit=1918%2C1074&amp;ssl=1\" data-orig-size=\"1918,1074\" 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=\"SwiftData\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftData.png?fit=660%2C369&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftData.png?resize=660%2C369&#038;ssl=1\" alt=\"\" class=\"wp-image-3078\" srcset=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftData.png?resize=1024%2C573&amp;ssl=1 1024w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftData.png?resize=300%2C168&amp;ssl=1 300w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftData.png?resize=768%2C430&amp;ssl=1 768w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftData.png?resize=1536%2C860&amp;ssl=1 1536w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftData.png?w=1918&amp;ssl=1 1918w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/SwiftData.png?w=1320&amp;ssl=1 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<p>Simplified Data Flow<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Start with data model created in SwiftData\n<ul class=\"wp-block-list\">\n<li>@Observable models use SwiftUI patterns but for DataFlow, if you pass a model thru intermediate views, they won\u2019t get invalidated if they don\u2019t use the property in the model<\/li>\n\n\n\n<li>Confirm session Discover Observation with SwiftUI<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>SwiftData are represented entirely by code. Will receive persistence and observable.\n<ul class=\"wp-block-list\">\n<li>Add a .modelContainer to you App View<\/li>\n\n\n\n<li>Add @Query to model in your views (tells swift data to do a fetch from database).&nbsp; Also works for document based apps.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Document Groups &#8211; automatically get sharing, renaming and more<\/li>\n\n\n\n<li>Inspectors &#8211; create side bars or sheets based on platform.<\/li>\n\n\n\n<li>Dialog customization\n<ul class=\"wp-block-list\">\n<li>Help Links &#8211;&nbsp;<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Lists and Tables for fine tuning them.\n<ul class=\"wp-block-list\">\n<li>Tables &#8211; Column order and visibility, and new Disclosure Table rows (for grouping)<\/li>\n\n\n\n<li>Sections now have programmatic expansion.<\/li>\n\n\n\n<li>Style formatting for smaller lists or tables.<\/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=\"368\" data-attachment-id=\"3081\" data-permalink=\"https:\/\/michaelrowe01.com\/index.php\/blog\/whats-new-in-swiftui\/attachment\/keyframe-animator\/\" data-orig-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Keyframe-Animator.png?fit=1898%2C1059&amp;ssl=1\" data-orig-size=\"1898,1059\" 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=\"Keyframe-Animator\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Keyframe-Animator.png?fit=660%2C368&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Keyframe-Animator.png?resize=660%2C368&#038;ssl=1\" alt=\"\" class=\"wp-image-3081\" srcset=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Keyframe-Animator.png?resize=1024%2C571&amp;ssl=1 1024w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Keyframe-Animator.png?resize=300%2C167&amp;ssl=1 300w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Keyframe-Animator.png?resize=768%2C429&amp;ssl=1 768w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Keyframe-Animator.png?resize=1536%2C857&amp;ssl=1 1536w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Keyframe-Animator.png?w=1898&amp;ssl=1 1898w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Keyframe-Animator.png?w=1320&amp;ssl=1 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<p>Extraordinary animations<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Animations can be improved with KeyFrames &#8211; triggered by state change. (Runs a set of animations in parallel)<\/li>\n\n\n\n<li>Phase animators (simpler than KeyFrame &#8211; step thru a sequence of animations)<\/li>\n\n\n\n<li>Haptic feedback uses new SensoryFeedback API &#8211; add a modifier .sensoryFeedback check HIG for Playing Haptics<\/li>\n\n\n\n<li>.visualEffects modifier &#8211; don\u2019t need geometry reader, to allow for an animation based on position on the screen.<\/li>\n\n\n\n<li>You can do text interpolation with .foregroundStyle so you can do cool metal shaders using ShaderLibrary.<\/li>\n\n\n\n<li>Sliders now have .symbolEffect modifier (can do it at a single item or the entire view).&nbsp; Check out (Animate Symbols in your app)<\/li>\n\n\n\n<li>You can do .textScale to a text view.<\/li>\n\n\n\n<li>.typesettingLanguage modifier will allow for text that requires more space like some languages (Thai)<\/li>\n\n\n\n<li><\/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=\"3083\" data-permalink=\"https:\/\/michaelrowe01.com\/index.php\/blog\/whats-new-in-swiftui\/attachment\/scrolleffects\/\" data-orig-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/ScrollEffects.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=\"ScrollEffects\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/ScrollEffects.png?fit=660%2C371&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/ScrollEffects.png?resize=660%2C371&#038;ssl=1\" alt=\"\" class=\"wp-image-3083\" srcset=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/ScrollEffects.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/ScrollEffects.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/ScrollEffects.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/ScrollEffects.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/ScrollEffects.png?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/ScrollEffects.png?w=1320&amp;ssl=1 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<p>Enhanced interactions<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>.scrollTransition modifier will allow effects to items in a scroll view.<\/li>\n\n\n\n<li>.containerRelativeFrame modifier allows for making things relative to other screen parts<\/li>\n\n\n\n<li>.scrollTargetLayout() &nbsp;<\/li>\n\n\n\n<li>.scrollPosition allows your do some thing based on position within the scroll view.<\/li>\n\n\n\n<li>.allowedDynamicRange modifier is now supported to show full fidelity, use sparingly (must be a performance hog)<\/li>\n\n\n\n<li>New Accessibility options. You can add .accessibilityZoomAction so voice over can access other actions like swipe actions.<\/li>\n\n\n\n<li>Color can look up customer colors defined in your asset Catalog.<\/li>\n\n\n\n<li>Menus now have improved visual styles<\/li>\n\n\n\n<li>New BorderShape styles for buttons&nbsp;<\/li>\n\n\n\n<li>.onKeyPress &#8211; allows for actions based on key presses (with modifiers)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>SwiftUI in more places Simplified Data Flow Extraordinary animations Enhanced interactions<\/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":[107,379,680],"class_list":["post-3033","post","type-post","status-publish","format-standard","hentry","category-blog","category-personal-softwareandit","tag-day-2","tag-swift","tag-wwdc23"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2aMa8-MV","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3033","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=3033"}],"version-history":[{"count":4,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3033\/revisions"}],"predecessor-version":[{"id":3084,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3033\/revisions\/3084"}],"wp:attachment":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/media?parent=3033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/categories?post=3033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/tags?post=3033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}