<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>SwiftUI on @yeniful blog</title><link>http://yeniful.github.io/tags/swiftui/</link><description>Recent content in SwiftUI on @yeniful blog</description><generator>Hugo -- 0.155.3</generator><language>en-us</language><lastBuildDate>Sat, 01 Mar 2025 00:00:00 +0900</lastBuildDate><atom:link href="http://yeniful.github.io/tags/swiftui/index.xml" rel="self" type="application/rss+xml"/><item><title>[SwiftUI] struct View vs @ViewBuilder 함수, 뭐가 다를까?</title><link>http://yeniful.github.io/posts/2025/20250301_swiftuiview/</link><pubDate>Sat, 01 Mar 2025 00:00:00 +0900</pubDate><guid>http://yeniful.github.io/posts/2025/20250301_swiftuiview/</guid><description>&lt;h2 id="모티베이션"&gt;모티베이션&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;재사용되는 View를 구조체로 빼야 하나, 아니면 그냥 함수로 만들어도 될까?&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;View를 만들 때 특별한 기준 없이 View를 만들 때 습관적으로 구조체를 만들거나, 간단한 건 함수로 처리하곤 했는데요. 앱의 구조와 성능, 유지보수 방식에 꽤 중요한 영향을 준다는 것을 알게 되었고, 간단한 내용이지만 한 번 정리해보고 싶었습니다.&lt;/p&gt;
&lt;p&gt;그래서 이번 글에서는 Apple 공식 문서와 WWDC 세션에서 강조한 원리를 바탕으로 &lt;strong&gt;struct View vs. @ViewBuilder 함수&lt;/strong&gt;의 차이를 정리해보려고 합니다.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="두-가지-방식-살펴보기"&gt;두 가지 방식 살펴보기&lt;/h2&gt;
&lt;p&gt;먼저 동일한 UI를 두 가지 방식으로 만들어봤습니다.&lt;/p&gt;</description></item></channel></rss>