{"id":46477,"date":"2025-01-17T16:20:49","date_gmt":"2025-01-17T21:20:49","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=46477"},"modified":"2025-01-17T16:20:58","modified_gmt":"2025-01-17T21:20:58","slug":"how-to-obtain-view-dimensions-in-swiftui","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2025\/01\/17\/how-to-obtain-view-dimensions-in-swiftui\/","title":{"rendered":"How to Obtain View Dimensions in SwiftUI"},"content":{"rendered":"<p><a href=\"https:\/\/fatbobman.com\/en\/snippet\/how-to-obtain-view-dimensions-in-swiftui\/\">Fatbobman<\/a>:<\/p>\n<blockquote cite=\"https:\/\/fatbobman.com\/en\/snippet\/how-to-obtain-view-dimensions-in-swiftui\/\">\n<p>Use <code>GeometryReader<\/code>, <code>onGeometryChange<\/code>, <code>visualEffect<\/code>, or <code>containerRelativeFrame<\/code> to dynamically retrieve and respond to view dimensions in SwiftUI. Each method caters to specific use cases and levels of customization.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Fatbobman: Use GeometryReader, onGeometryChange, visualEffect, or containerRelativeFrame to dynamically retrieve and respond to view dimensions in SwiftUI. Each method caters to specific use cases and levels of customization.<\/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":"2025-01-17T21:20:51Z","apple_news_api_id":"9cc234fa-0ebd-4581-8b02-c529c4b8760a","apple_news_api_modified_at":"2025-01-17T21:21:00Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/AnMI0-g69RYGLAsUpxLh2Cg","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":[31,2586,30,2598,71,1812],"class_list":["post-46477","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-ios","tag-ios-18","tag-mac","tag-macos-15-sequoia","tag-programming","tag-swiftui"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/46477","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=46477"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/46477\/revisions"}],"predecessor-version":[{"id":46479,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/46477\/revisions\/46479"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=46477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=46477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=46477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}