<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">
	<channel>
		<title>Author at Infinum</title>
		<atom:link href="https://infinum.com/blog/author/lucija-balja/feed/" rel="self" type="application/rss+xml" />
		<link></link>
		<description>Building digital products</description>
		<lastBuildDate>Thu, 16 Apr 2026 11:27:35 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>

					<item>
				<image>
					<url>19253201https://infinum.com/uploads/2024/04/How_to_get_everyone_on_board_blogpost-hero-ig-min.webp</url>
				</image>
				<title>How We Got Everyone on Board with a New Technology</title>
				<link>https://infinum.com/blog/implementing-new-technology-in-an-organization/</link>
				<pubDate>Mon, 22 Apr 2024 11:17:44 +0000</pubDate>
				<dc:creator>Lucija Balja</dc:creator>
				<guid isPermaLink="false">https://infinum.com/?p=19253201</guid>
				<description>
					<![CDATA[<p>Overcome the challenges of implementing new technology in an organization. Learn how we successfully organized a workshop to get everyone on board with Swift UI.</p>
<p>The post <a href="https://infinum.com/blog/implementing-new-technology-in-an-organization/">How We Got Everyone on Board with a New Technology</a> appeared first on <a href="https://infinum.com">Infinum</a>.</p>
]]>
				</description>
				<content:encoded>
					<![CDATA[<div
	class="wrapper"
	data-id="es-259"
	 data-animation-target='inner-items'>
		
			<div class="wrapper__inner">
			<div class="block-blog-content js-block-blog-content">
	
<div class="block-blog-content-sidebar" data-id="es-92">
	</div>

<div class="block-blog-content-main">
	
<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-95"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-93">
	<p	class='typography typography--size-36-text js-typography block-paragraph__paragraph'
	data-id='es-94'
	>
	Implementing new technology in an organization can be challenging, especially in a tech-driven environment. Here’s how we successfully organized a workshop for 45 team members and got everyone on board with SwiftUI.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-98"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-96">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-97'
	>
	The journey of introducing a new technology to a large team, such as ours, with approximately 45 members, is no small feat. <strong>Resistance to change</strong> is a common human inclination, especially when dealing with a group with diverse opinions and experiences. </p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-101"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-99">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-100'
	>
	However, we sometimes need to introduce a new technology to <strong>improve processes and collective efficiency</strong>. The stakes are high; mishandling this transition can lead to disrupted workflows, decreased productivity, and uncertainty among employees.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-104"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-102">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-103'
	>
	This scenario is not uncommon and can arise in various professional landscapes, but especially in tech-driven environments. In this article, we&#8217;ll present <strong>a strategic approach to employee training</strong> that effectively addresses these challenges using the example of the SwiftUI workshop organized for our iOS team.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-107"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-105">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-106'
	>
	The beauty of our strategy lies in its versatility—it&#8217;s applicable not just to specific technologies or teams but to <strong>any scenario</strong> where we introduce <strong>innovation</strong> to <strong>diverse groups</strong>.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-110"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-108">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-109'
	>
	Finding the time </h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-113"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-111">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-112'
	>
	The technology implementation process can be a considerable effort, especially if the employees are booked full-time on project work. Some people don&#8217;t have enough time to learn a new technology, while others may just be comfortable and content working with the old one. Whatever the reason, they may not have any inclination to learn something new. </p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-115"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-highlighted-text">
	<p	class='typography typography--size-36-text js-typography block-highlighted-text__typography'
	data-id='es-114'
	>
	<strong>Time constraints and varying levels of knowledge pose significant challenges for the implementation of technology. That&#8217;s why we have decided to organize a workshop for everyone. </strong></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-118"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-116">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-117'
	>
	With the help of our planning department, we successfully allocated a sufficient number of hours for <strong>workshop preparation</strong>, <strong>lectures</strong>, and <strong>homework assignments</strong>. We effectively broke this down into manageable chunks of a few hours per week, ensuring it didn&#8217;t disrupt our team members&#8217; daily workflow. As a result, <strong>we completed the entire initiative within six months</strong>. </p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-121"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-119">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-120'
	>
	Preparation phase – pave the way for success</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-124"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-122">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-123'
	>
	The <strong>planning process</strong> played a key role in the workshop&#8217;s later success. In an initial meeting, which included team leads, tech leads, senior engineers, and lecturers, we crafted <strong>an agenda for each of the six lectures</strong>. The workload was distributed among three lecturers with previous experience with the new technology.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-127"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-125">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-126'
	>
	We planned agendas for five of the six lectures, leaving the sixth open-ended to cover any missed content or spillovers.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-129"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-highlighted-text">
	<p	class='typography typography--size-36-text js-typography block-highlighted-text__typography'
	data-id='es-128'
	>
	Live coding became our preferred presentation method, setting our workshop apart from generic online tutorials. </p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-132"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-130">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-131'
	>
	We prepared the presentations, code samples, design, and homework assignments in the following months.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-135"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-133">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-134'
	>
	It&#8217;s important to emphasize <strong>the importance of weekly syncs</strong> in these scenarios. During these sessions, presenters showcase their weekly progress, which encourages them to <strong>work consistently</strong> and make <strong>steady progress</strong>. This practice is the key reason we didn&#8217;t have a rush of work in the final minutes before the workshop execution.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-138"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-136">
	<h3	class='typography typography--size-24-text js-typography block-heading__heading'
	data-id='es-137'
	>
	Tip no. 1:</h3></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-140"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-highlighted-text">
	<p	class='typography typography--size-24-text js-typography block-highlighted-text__typography'
	data-id='es-139'
	>
	Set the agenda and distribute work early in the process. This way, lecturers can work on the content at their own pace and have enough time to prepare everything.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-143"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-141">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-142'
	>
	Our strategy involved homework assignments for the first three lectures, focusing on <strong>foundational aspects</strong> of the newly introduced technology. </p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-146"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-144">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-145'
	>
	In the following three lectures, instead of traditional homework, participants were tasked with <strong>integrating the new technology</strong> into their actual <strong>ongoing projects</strong>. Throughout the process, they had full, active support from the lecturers. This principle of <strong>learning by doing</strong> not only promotes a deeper comprehension of the technology but also empowers participants to directly apply their knowledge in real-world scenarios.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-149"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-147">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-148'
	>
	The complexity of the homework increased progressively from lecture to lecture, with the first being the easiest and the last the most challenging.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-152"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-150">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-151'
	>
	Some additional rules we decided on:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-155"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="lists" data-id="es-153">
	<ul	class='typography typography--size-16-text-roman js-typography lists__typography'
	data-id='es-154'
	>
	<li>Each lecture was recorded.</li><li>Lecture attendance and homework were mandatory.</li><li>At the beginning of each lecture, we briefly discussed the homework from the previous lecture.</li></ul></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-158"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-156">
	<h3	class='typography typography--size-24-text js-typography block-heading__heading'
	data-id='es-157'
	>
	Tip no. 2:</h3></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-160"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-highlighted-text">
	<p	class='typography typography--size-24-text js-typography block-highlighted-text__typography'
	data-id='es-159'
	>
	Do a test run and present the subject to someone unfamiliar with it. This ensures that attendees with varying levels of previous knowledge can clearly understand your statements, allows for content adjustments, and provides perspective on any overlooked aspects—a crucial step when you&#8217;re experienced in the subject matter.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-163"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-161">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-162'
	>
	A pre-workshop survey can reveal valuable information</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-166"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-164">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-165'
	>
	To fine-tune our technology implementation plan, we sent out a <strong>pre-workshop survey</strong>. The information we got on participants&#8217; familiarity, experience, interest, and expectations was invaluable.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-169"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-167">
	<h3	class='typography typography--size-24-text js-typography block-heading__heading'
	data-id='es-168'
	>
	Tip no. 3:</h3></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-171"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-highlighted-text">
	<p	class='typography typography--size-24-text js-typography block-highlighted-text__typography'
	data-id='es-170'
	>
	A pre-workshop survey is your compass, helping you navigate different knowledge levels within the team. Send a survey even before you&#8217;ve started preparing the lectures. You will have a better idea of what to include in the workshop and the level of detail needed.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-174"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-172">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-173'
	>
	Some questions you may ask:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-177"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="lists" data-id="es-175">
	<ul	class='typography typography--size-16-text-roman js-typography lists__typography'
	data-id='es-176'
	>
	<li>How would you rate your knowledge of [enter technology name]?</li><li>How interested are you in learning [enter technology name]?</li><li>How much experience on real projects do you have with [enter technology name]?</li><li>What are your expectations or goals for this workshop?</li></ul></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-180"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-178">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-179'
	>
	Our survey results revealed <strong>a range of familiarity</strong>, with an average SwiftUI knowledge grade of <strong>4.6/10</strong>. This grade showed that most people aren&#8217;t that familiar with the new technology and that we should tailor the lectures accordingly. Still, we tried to accommodate both novices and those with some experience by adding <strong>behind-the-scenes details</strong> and <strong>advanced insights</strong> after covering the basics.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-183"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-181">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-182'
	>
	Preparation stage completed. Get the cameras rolling.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-186"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-184">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-185'
	>
	Execution time – holding the workshop </h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-189"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-187">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-188'
	>
	The workshop kicked off with enthusiasm and active employee engagement. Half the team gathered in the conference room, while the other half joined remotely. After setting up, we started with the essentials—the crucial first part. The lecture included <strong>presentations</strong>, <strong>code samples</strong>, and a <strong>Q&amp;A session</strong>. Everyone participated actively; questions flowed, and the atmosphere was positive.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-192"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-190">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-191'
	>
	However, not everything went as smoothly as expected.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-195"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-193">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-194'
	>
	Post-lecture feedback revealed that <strong>remote participants had trouble hearing us</strong>, particularly when there were questions from the room—a key interactive segment.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-198"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-196">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-197'
	>
	This employee feedback proved invaluable. Before the following lecture, we dedicated time to finding the right room and equipment, ensuring <strong>communication can run smoothly</strong>.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-201"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-199">
	<h3	class='typography typography--size-24-text js-typography block-heading__heading'
	data-id='es-200'
	>
	Tip no. 4:</h3></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-203"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-highlighted-text">
	<p	class='typography typography--size-24-text js-typography block-highlighted-text__typography'
	data-id='es-202'
	>
	Checking and preparing the right equipment and tools beforehand is as crucial as content preparation.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-206"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-204">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-205'
	>
	After the lecture, we assigned a <strong>30-minute homework</strong> to be solved and submitted before the next session (a week later). Many participants submitted their homework in the same week, signaling <strong>positive engagement</strong>. Each person received <strong>detailed feedback</strong> on their homework, covering SwiftUI&#8217;s behind-the-scenes aspects, best practices, tips, tricks, and tools for improvement.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-209"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-207">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-208'
	>
	Participants greatly appreciated the advice, as nearly everyone applied the feedback in their following assignments.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-212"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-210">
	<h3	class='typography typography--size-24-text js-typography block-heading__heading'
	data-id='es-211'
	>
	Tip no. 5:</h3></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-214"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-highlighted-text">
	<p	class='typography typography--size-24-text js-typography block-highlighted-text__typography'
	data-id='es-213'
	>
	Providing comprehensive and positive feedback on homework plays a central role in boosting attendees&#8217; morale and ensuring employee buy-in.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-217"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-215">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-216'
	>
	We encountered a slight hiccup with the first homework—time management. Due to varying knowledge levels, some completed it in 20 minutes, while others required two hours. Planning, scheduling, and adapting to diverse participant needs are crucial aspects.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-220"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-218">
	<h3	class='typography typography--size-24-text js-typography block-heading__heading'
	data-id='es-219'
	>
	Tip no. 6:</h3></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-222"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-highlighted-text">
	<p	class='typography typography--size-24-text js-typography block-highlighted-text__typography'
	data-id='es-221'
	>
	When planning the time for homework assignments, consider optimal and challenging scenarios. Efficiently redistribute time, keeping in mind potential variations in participants&#8217; pace.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-225"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-223">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-224'
	>
	Our <strong>time distribution strategy</strong> worked well, especially since we didn&#8217;t assign homework for lectures 4, 5, and 6. This allowed participants to invest more time in initial assignments and have more free time on their hands later on.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-228"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-226">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-227'
	>
	All five lectures flew by, filled with fun and <strong>valuable learning experiences</strong>. Before the sixth lecture, we sent out a <strong>form</strong> to gather <strong>input</strong> on what attendees wanted from the final session—revisions, deeper dives into specific topics, or insights into SwiftUI usage in existing projects.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-231"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-229">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-230'
	>
	The responses indicated a desire to explore SwiftUI&#8217;s application in our existing projects, focusing on <strong>data binding</strong> and <strong>integration into UIKit codebases</strong>. With a week to prepare, we opted to showcase our codebases during the final lecture.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-234"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-232">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-233'
	>
	And with that, we concluded our SwiftUI workshop.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-237"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-235">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-236'
	>
	The aftermath – workshop objectives achieved</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-240"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-238">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-239'
	>
	The enthusiasm stayed in the air post-lectures. Heated discussions about technology choices highlighted the <strong>newfound interest</strong> within the team.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-243"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-241">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-242'
	>
	The post-workshop survey results spoke volumes. Attendees rated their <strong>knowledge</strong> an average of 6.3, a <strong>37% increase</strong>. The <strong>satisfaction rate</strong> with workshop content was graded as <strong>4.78/5</strong>, meaning we mostly satisfied both experienced and less experienced folks. The <strong>live hands-on approach</strong> stood out as the favorite aspect of the workshop, playing a significant role in the team&#8217;s overall <strong>skill development</strong>.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-246"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-244">
	<h3	class='typography typography--size-24-text js-typography block-heading__heading'
	data-id='es-245'
	>
	Tip no. 7:</h3></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-248"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-highlighted-text">
	<p	class='typography typography--size-24-text js-typography block-highlighted-text__typography'
	data-id='es-247'
	>
	Engage your audience with a hands-on approach and live coding for effective knowledge transfer. Rather than just talking about it, demonstrating how to do something is key.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-251"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-249">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-250'
	>
	With 85% of projects currently using SwiftUI and almost all new features on these projects being implemented using SwiftUI, our workshop <strong>achieved its objectives</strong>. The time spent on careful planning, lectures, and homework reviews was well worth the <strong>transformative results</strong>.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-254"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-252">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-253'
	>
	Implementing a new technology in an organization doesn’t have to be hard</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-257"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-255">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-256'
	>
	Our journey demonstrates that a <strong>well-organized</strong>, <strong>adaptable</strong>, and <strong>engaging</strong> <strong>workshop</strong> can bridge the gap between old and new technologies within a team. Embrace change, empower your team, and <strong>witness the transformation</strong>.</p></div>	</div>
</div>
</div>		</div>
	</div><p>The post <a href="https://infinum.com/blog/implementing-new-technology-in-an-organization/">How We Got Everyone on Board with a New Technology</a> appeared first on <a href="https://infinum.com">Infinum</a>.</p>
]]>
				</content:encoded>
			</item>
					<item>
				<image>
					<url>32044https://infinum.com/uploads/2023/01/ChatGPT-vs-SwiftUI-HERO.webp</url>
				</image>
				<title>Using ChatGPT to Learn SwiftUI – Does It Work?</title>
				<link>https://infinum.com/blog/learn-swiftui-with-chatgpt/</link>
				<pubDate>Tue, 17 Jan 2023 11:34:38 +0000</pubDate>
				<dc:creator>Lucija Balja</dc:creator>
				<guid isPermaLink="false">https://infinum.com/?p=32044</guid>
				<description>
					<![CDATA[<p>We glimpse into the future of learning, coding, and building new things by assessing how ChatGPT can help enhance the SwiftUI learning experience.</p>
<p>The post <a href="https://infinum.com/blog/learn-swiftui-with-chatgpt/">Using ChatGPT to Learn SwiftUI – Does It Work?</a> appeared first on <a href="https://infinum.com">Infinum</a>.</p>
]]>
				</description>
				<content:encoded>
					<![CDATA[<div
	class="wrapper"
	data-id="es-510"
	 data-animation-target='inner-items'>
		
			<div class="wrapper__inner">
			<div class="block-blog-content js-block-blog-content">
	
<div class="block-blog-content-sidebar" data-id="es-260">
	</div>

<div class="block-blog-content-main">
	
<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-263"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-261">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-262'
	>
	Since its launch in November 2022, OpenAI’s text generator ChatGPT has drawn a lot of attention with its highly competent, conversational answers to a wide array of questions on various topics. Built on top of OpenAI’s GPT-3 family of large language models, it can understand natural language and generate written content based on user prompts.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-266"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-264">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-265'
	>
	ChatGPT’s capabilities have themselves prompted an exploration of potential use cases in different domains – from school tasks to content marketing. As an iOS engineer, I got the idea to try out ChatGPT in combination with another reasonably new technology, SwiftUI.&nbsp;</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-269"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-267">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-268'
	>
	In this article, we’ll evaluate the accuracy of ChatGPT’s answers and assess whether the tool can help enhance the SwiftUI learning experience. Let’s catch a glimpse into the future of learning, coding, and building new things.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-276"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<a	class="card-simple js-card-simple card-simple--is-ad block-card__card-simple card-simple--has-link js-card-simple-link card-simple__content-align--left"
	data-id="es-270"
	 href='https://infinum.com/artificial-intelligence/agent-development/'>

	
	
	<div class="card-simple__content">
		<div class="card-simple__heading-wrap">
			<p	class='typography typography--size-24-text js-typography card-simple__heading'
	data-id='es-271'
	>
	<strong>As the pressure to implement AI grows, many businesses don&#8217;t know where to start. Our 14-day sprint helps you cut through the noise, turning early ideas into validated prototypes with clear logic, smart design, and real momentum. Learn how it works.</strong></p>		</div>

		<button	class="btn btn--color-infinum btn--size-small btn--width-default btn__icon-position--right card-simple__btn js-block-card-btn js-card-simple-link"
	data-id="es-273"
	 tabindex='-1'>
		<div class="btn__inner">
					<div	class='typography typography--size-none js-typography btn__label'
	data-id='es-274'
	>
	Learn more </div>		
		<i
	class="icon btn__icon icon--size-16 icon--scale-100"
	 aria-hidden='true' data-name='arrow-right-16' data-id='es-275'>
	<svg fill='none' height='16' viewBox='0 0 17 16' width='17' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'><g stroke='currentColor' stroke-width='2'><path d='m.5 7.99999 14 .00001'/><path d='m9.23352 2.7251 5.97848 5.97852'/><path d='m9.23352 13.2744 5.97848-5.9785'/></g></svg></i>	</div>
	</button>	</div>
</a>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-279"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-277">
	<h2	class='typography typography--size-52-default js-typography block-typography__typography'
	data-id='es-278'
	>
	<strong>Using ChatGPT to understand code in SwiftUI</strong></h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-282"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-280">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-281'
	>
	Starting with the basics, let’s check what ChatGPT can do for somebody new to SwiftUI. Like any confused developer coming to a new technology, I prompted it with a very natural and simple sentence:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-285"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-283">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-284'
	>
	I am building an app in SwiftUI and don&#8217;t know where to start.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-288"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-286">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-287'
	>
	The chatbot’s response was:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-291"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-289">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-290'
	>
	It&#8217;s great that you&#8217;re building an app in SwiftUI! Here are some steps you can take to get started:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-295"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-292">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-293'
	>
	1</p>	<div class="bullet__content">
		<p	class='typography typography--size-16-text-roman js-typography bullet__paragraph'
	data-id='es-294'
	>
	Familiarize yourself with the basics of SwiftUI. You can do this by reading through Apple&#8217;s documentation, or by working through a tutorial.</p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-299"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-296">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-297'
	>
	2</p>	<div class="bullet__content">
		<p	class='typography typography--size-16-text-roman js-typography bullet__paragraph'
	data-id='es-298'
	>
	Think about what your app will do and what it will look like. You can start by sketching out your app&#8217;s user interface and defining its functionality.</p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-303"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-300">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-301'
	>
	3</p>	<div class="bullet__content">
		<p	class='typography typography--size-16-text-roman js-typography bullet__paragraph'
	data-id='es-302'
	>
	Set up a new Xcode project and begin building your app. You can use the &#8220;Single View App&#8221; template as a starting point and build from there.</p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-307"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-304">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-305'
	>
	4</p>	<div class="bullet__content">
		<p	class='typography typography--size-16-text-roman js-typography bullet__paragraph'
	data-id='es-306'
	>
	As you build your app, you can use the SwiftUI preview feature to see how your code changes will look in real-time.</p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-310"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-308">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-309'
	>
	I hope this helps you get started with your SwiftUI app! Let me know if you have any other questions.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-313"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-311">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-312'
	>
	This is a pretty good start, both for my conversation with ChatGPT and for anyone actually onboarding to SwiftUI. This response is 10/10, I couldn&#8217;t have written it better myself.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-316"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-314">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-315'
	>
	Let’s move on to another common situation a non-experienced developer may encounter early on. When learning a new technology, you’ll often stumble upon a piece of code that you don’t understand or need some guidance with.&nbsp;</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-319"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-317">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-318'
	>
	I asked the chatbot a simple question:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-322"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-320">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-321'
	>
	What does this code do?</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-324"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-swift github-light" data-language="swift" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">struct Movie</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #6f42c1;">Identifiable </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">let id:</span><span class="token"> UUID</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">let title:</span><span class="token"> </span><span class="token" style="color: #005cc5;">String</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">let releaseYear:</span><span class="token"> </span><span class="token" style="color: #005cc5;">Int</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">let posterImage:</span><span class="token"> Image</span><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">struct MovieList</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #6f42c1;">View </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">  </span><span class="token">let movies:</span><span class="token"> </span><span class="token">[</span><span class="token">Movie</span><span class="token">]</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">  </span><span class="token">var body:</span><span class="token"> </span><span class="token" style="color: #d73a49;">some</span><span class="token"> View </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">      </span><span class="token">List</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">ForEach(</span><span class="token">movies</span><span class="token">, </span><span class="token">id:</span><span class="token"> \.</span><span class="token">id</span><span class="token">)</span><span class="token"> </span><span class="token">{</span><span class="token"> movie </span><span class="token" style="color: #d73a49;">in</span><span class="token">
</span></span><span class="line"><span class="token">          </span><span class="token">HStack</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            movie.</span><span class="token">posterImage</span><span class="token">
</span></span><span class="line"><span class="token">              .</span><span class="token">resizable(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">              .</span><span class="token">frame(</span><span class="token">width:</span><span class="token"> </span><span class="token" style="color: #005cc5;">50</span><span class="token">, </span><span class="token">height:</span><span class="token"> </span><span class="token" style="color: #005cc5;">50</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">Text(</span><span class="token">movie.</span><span class="token">title</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">Spacer(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">Text(</span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">\(</span><span class="token" style="color: #032f62;">movie.</span><span class="token" style="color: #032f62;">releaseYear</span><span class="token" style="color: #032f62;">)</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">          </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">      </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-327"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-325">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-326'
	>
	This was the answer: </p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-330"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-328">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-329'
	>
	<em>This code defines two `<strong>struct</strong>`s in SwiftUI: `<strong>Movie`</strong> and `<strong>MovieList`</strong>. </em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-333"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-331">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-332'
	>
	<em>The `<strong>Movie`</strong> struct represents a movie with an `<strong>id`</strong> of type `<strong>UUID`</strong>, a `<strong>title`</strong> of type `<strong>String`</strong>, a `<strong>releaseYear`</strong> of type `<strong>Int`</strong>, and a `<strong>posterImage`</strong> of type `<strong>Image`</strong>. </em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-336"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-334">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-335'
	>
	<em>The `<strong>MovieList`</strong> struct represents a view that displays a list of movies. It has a single property `<strong>movies`</strong> of type `<strong>[Movie]`</strong>, which is an array of `<strong>Movie`</strong> structs. The `<strong>MovieList`</strong> struct conforms to the `<strong>View`</strong> protocol, which means it can be used to build a user interface in SwiftUI. The `<strong>body`</strong> property of the `<strong>MovieList`</strong> struct is a computed property of type `<strong>some View`</strong>. It returns a `<strong>List`</strong> view that displays a list of movies. The `<strong>List`</strong> view is populated using a `<strong>ForEach`</strong> loop, which iterates over the `<strong>movies`</strong> array and creates a row for each movie. Each row consists of an `<strong>HStack`</strong> view that contains the movies’s poster image, title, and release year. The poster image is made resizable and given a fixed size using the `<strong>resizable()`</strong> and `<strong>frame(width:height)`</strong> modifiers. The title and release year are displayed as text using the `<strong>Text`</strong> view. The `<strong>Spacer`</strong> view is used to push the release year to the right side of the row.</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-339"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-337">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-338'
	>
	This is a pretty detailed explanation that demonstrates knowledge of key SwiftUI concepts and components, like HStack and Spacer, but also the View protocol. The result can be rated as completely accurate. Another 10/10.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-342"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-340">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-341'
	>
	However, wanting to get into more detail, I asked it:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-345"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-343">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-344'
	>
	Why does the Movie model need to conform to Identifiable protocol?</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-348"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-346">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-347'
	>
	Here is how ChatGPT replied: </p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-351"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-349">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-350'
	>
	<em>The `<strong>ForEach</strong>` view in SwiftUI requires that the items in its collection conform to the `<strong>Identifiable</strong>` protocol. The `<strong>Identifiable`</strong> protocol has a single requirement: that the conforming type has an `<strong>id`</strong> property of type `<strong>Hashable`</strong>. </em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-354"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-352">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-353'
	>
	<em>In this case, the `<strong>Movie`</strong> struct conforms to the `<strong>Identifiable`</strong> protocol by having an `<strong>id`</strong> property of type `<strong>UUID`</strong>. This allows the `<strong>ForEach`</strong> loop to create a unique identifier for each movie in the list and use it to identify each movie as it is rendered in the list. </em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-357"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-355">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-356'
	>
	<em>The `<strong>ForEach</strong>`view uses the `<strong>id`</strong> property of each movie to create a unique identifier that it can use to track the movie as it is rendered in the list. This is necessary because the `<strong>ForEach</strong>`view reuses rows in the list as the user scrolls. By using the `<strong>id`</strong> property to identify each movie, the `<strong>Foreach</strong>`view can ensure that the correct movie is displayed in each row as it is reused.</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-360"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-358">
	<p	class='typography typography--size-20-text-roman js-typography block-typography__typography'
	data-id='es-359'
	>
	The answer looks pretty straightforward. However, it’s not completely correct. <code>ForEach</code> doesn’t have any mechanisms for reusing cells and does no such thing. On the other hand, List does, so maybe this caused ChatGPT’s confusion and resulted in a somewhat incorrect answer. <code>ForEach</code> is a simple component that loads all the views at once but requires identifiable models because of UI updates, not because rows are reused as the user scrolls. </p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-363"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-361">
	<p	class='typography typography--size-20-text-roman js-typography block-typography__typography'
	data-id='es-362'
	>
	I would advise caution here because while answers may look plausible, they will not necessarily always be correct. So it’s best always to double-check and ask many follow-up questions to get the right answer.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-366"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-364">
	<h2	class='typography typography--size-52-default js-typography block-typography__typography'
	data-id='es-365'
	>
	<strong>Using ChatGPT to improve code in SwiftUI</strong></h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-369"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-367">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-368'
	>
	Now that we have the basics down, let’s take it a step further and see if ChatGPT can help me improve my code and explain what I did wrong.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-372"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-370">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-371'
	>
	I asked another simple question and provided a chunk of code.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-375"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-373">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-374'
	>
	Can you improve this code?</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-377"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-swift github-light" data-language="swift" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">List</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">ForEach(</span><span class="token">movies</span><span class="token">)</span><span class="token"> </span><span class="token">{</span><span class="token"> movie </span><span class="token" style="color: #d73a49;">in</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">HStack</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            movie.</span><span class="token">posterImage</span><span class="token">
</span></span><span class="line"><span class="token">                .</span><span class="token">resizable(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                .</span><span class="token">frame(</span><span class="token">width:</span><span class="token"> </span><span class="token" style="color: #005cc5;">50</span><span class="token">, </span><span class="token">height:</span><span class="token"> </span><span class="token" style="color: #005cc5;">50</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">Text(</span><span class="token">movie.</span><span class="token">title</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">Spacer(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">Text(</span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">\(</span><span class="token" style="color: #032f62;">movie.</span><span class="token" style="color: #032f62;">releaseYear</span><span class="token" style="color: #032f62;">)</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">struct MovieList</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #6f42c1;">View </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">var body:</span><span class="token"> </span><span class="token" style="color: #d73a49;">some</span><span class="token"> View </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">List</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">ForEach(</span><span class="token">movies</span><span class="token">)</span><span class="token"> </span><span class="token">{</span><span class="token"> movie </span><span class="token" style="color: #d73a49;">in</span><span class="token">
</span></span><span class="line"><span class="token">                </span><span class="token">HStack</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">                    movie.</span><span class="token">posterImage</span><span class="token">
</span></span><span class="line"><span class="token">                        .</span><span class="token">resizable(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                        .</span><span class="token">frame(</span><span class="token">width:</span><span class="token"> </span><span class="token" style="color: #005cc5;">50</span><span class="token">, </span><span class="token">height:</span><span class="token"> </span><span class="token" style="color: #005cc5;">50</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                    </span><span class="token">Text(</span><span class="token">movie.</span><span class="token">title</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                    </span><span class="token">Spacer(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                    </span><span class="token">Text(</span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">\(</span><span class="token" style="color: #032f62;">movie.</span><span class="token" style="color: #032f62;">releaseYear</span><span class="token" style="color: #032f62;">)</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">          </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-380"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-378">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-379'
	>
	This is what ChatGPT had to say in response:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-383"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-381">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-382'
	>
	<em>Here are a few suggestions for improving the code:</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-387"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-384">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-385'
	>
	1</p>	<div class="bullet__content">
		<p	class='typography typography--size-16-text-roman js-typography bullet__paragraph'
	data-id='es-386'
	>
	<em>You can make the code easier to read by adding some vertical whitespace between the `<strong>List</strong>` view and the `<strong>ForEach</strong>` loop. This will help to visually separate the list from the rest of the view. </em></p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-391"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-388">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-389'
	>
	2</p>	<div class="bullet__content">
		<p	class='typography typography--size-16-text-roman js-typography bullet__paragraph'
	data-id='es-390'
	>
	<em>You can make the code more efficient by using the `<strong>id`</strong> parameter of the `<strong>ForEach`</strong> loop to specify a unique identifier for each movie. This will allow the `<strong>ForEach`</strong> loop to track each movie efficiently as it is rendered in the list. </em></p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-395"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="bullet bullet--left bullet__type--number bullet__color--black block-bullet__bullet" data-id="es-392">
	<p	class='typography typography--size-14-text js-typography bullet__dot'
	data-id='es-393'
	>
	3</p>	<div class="bullet__content">
		<p	class='typography typography--size-16-text-roman js-typography bullet__paragraph'
	data-id='es-394'
	>
	<em>You can make the code more flexible by using a `<strong>MovieRow`</strong> view to display each movie in the list. This will allow you to reuse the movie row code n other views, and will make it easier to modify the appearance of the movie rows.</em></p>	</div>
</div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-398"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-396">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-397'
	>
	This was the refactored code provided by ChatGPT:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-400"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-php github-light" data-language="php" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token" style="color: #005cc5;">struct</span><span class="token"> </span><span class="token" style="color: #005cc5;">MovieRow</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #005cc5;">View</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token" style="color: #005cc5;">let</span><span class="token"> </span><span class="token" style="color: #005cc5;">movie</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #005cc5;">Movie</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token" style="color: #d73a49;">var</span><span class="token"> </span><span class="token" style="color: #005cc5;">body</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #005cc5;">some</span><span class="token"> </span><span class="token" style="color: #005cc5;">View</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #005cc5;">HStack</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token" style="color: #005cc5;">movie</span><span class="token" style="color: #d73a49;">.</span><span class="token" style="color: #005cc5;">posterImage</span><span class="token">
</span></span><span class="line"><span class="token">                </span><span class="token" style="color: #d73a49;">.</span><span class="token" style="color: #6f42c1;">resizable</span><span class="token">(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                </span><span class="token" style="color: #d73a49;">.</span><span class="token" style="color: #6f42c1;">frame</span><span class="token">(</span><span class="token" style="color: #6f42c1;">width</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #005cc5;">50</span><span class="token">,</span><span class="token"> </span><span class="token" style="color: #6f42c1;">height</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #005cc5;">50</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token" style="color: #6f42c1;">Text</span><span class="token">(</span><span class="token" style="color: #005cc5;">movie</span><span class="token" style="color: #d73a49;">.</span><span class="token" style="color: #005cc5;">title</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token" style="color: #6f42c1;">Spacer</span><span class="token">(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token" style="color: #6f42c1;">Text</span><span class="token">(</span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">\(movie.releaseYear)</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token" style="color: #005cc5;">struct</span><span class="token"> </span><span class="token" style="color: #005cc5;">MovieList</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #005cc5;">View</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token" style="color: #005cc5;">let</span><span class="token"> </span><span class="token" style="color: #005cc5;">movies</span><span class="token">:</span><span class="token"> </span><span class="token">[</span><span class="token" style="color: #005cc5;">Movie</span><span class="token">]</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token" style="color: #d73a49;">var</span><span class="token"> </span><span class="token" style="color: #005cc5;">body</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #005cc5;">some</span><span class="token"> </span><span class="token" style="color: #005cc5;">View</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #005cc5;">List</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token" style="color: #6f42c1;">ForEach</span><span class="token">(</span><span class="token" style="color: #005cc5;">movies</span><span class="token">,</span><span class="token"> </span><span class="token" style="color: #6f42c1;">id</span><span class="token">:</span><span class="token"> \</span><span class="token" style="color: #d73a49;">.</span><span class="token" style="color: #005cc5;">id</span><span class="token">)</span><span class="token"> </span><span class="token">{</span><span class="token"> </span><span class="token" style="color: #005cc5;">movie</span><span class="token"> </span><span class="token" style="color: #005cc5;">in</span><span class="token">
</span></span><span class="line"><span class="token">                </span><span class="token" style="color: #6f42c1;">MovieRow</span><span class="token">(</span><span class="token" style="color: #6f42c1;">movie</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #005cc5;">movie</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-403"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-401">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-402'
	>
	Let’s analyze the proposed solution. The first bullet is mostly useless as there is no point in adding an extra line between the <code>List</code> and <code>ForEach</code> components. I would advise against this suggestion. The ChatGPT’s proposition is probably based on general programming language style guides that are not really relevant in SwiftUI.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-406"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-404">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-405'
	>
	The second bullet doesn’t have any performance gain as opposed to just conforming the model to Identifiable. The last bullet is the best one; it suggests a pretty good separation of view, just like Apple advises. </p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-409"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-407">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-408'
	>
	Some bullets were not really useful or wholly related to this technology, but I can understand why they came up. ChatGPT focused on some general rules for making your code more readable and cleaner. The last bullet was absolutely in line with SwiftUI and provided an excellent explanation. </p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-412"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-410">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-411'
	>
	Moving on to a different issue, it’s important to keep in mind how SwiftUI significantly changes how we write and think about UI. The constraints of UIKit, as well as its tedious setup, are gone. Many newbies have a hard time adapting to this and need some help in the process. Let’s see how ChatGPT understands SwiftUI in its core, its APIs, and whether it can help me transition faster.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-415"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-413">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-414'
	>
	I wondered how ChatGPT handles width and height tasks, something very tricky in the SwiftUI framework, which is declarative by nature.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-418"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-416">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-417'
	>
	My prompt was:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-421"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-419">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-420'
	>
	How to make Image resize to a width of the screen subtracted by 20 points and have the same height?</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-424"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-422">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-423'
	>
	This is what ChatGPT suggested: </p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-427"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-425">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-426'
	>
	<em>To make the image resize to a width of the screen subtracted by 20 points and have the same height, you can use the `<strong>GeometryReader</strong>` view to get the width of the screen and the `<strong>aspectRatio</strong>` modifier to preserve the aspect ratio of the image.</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-430"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-428">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-429'
	>
	<em>In this example, the `<strong>GeometryReader</strong>` view reads the width of the screen and passes it to the `<strong>frame(width:)</strong>` modifier as the `<strong>geometry.size.width</strong>` value. The `<strong>aspectRatio(contentMode:)</strong>` modifier is used to preserve the</em> <em>aspect ratio of a view. The contentMode parameter determines how the view&#8217;s aspect ratio should be calculated. For example, a `<strong>Text (&#8220;Hello, world!&#8221;)</strong>` with an aspectRatio of 2:1 and contentMode `<strong>.fit</strong>` have the width twice the height and the text will be scaled to fit the parent view. </em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-433"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-431">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-432'
	>
	<em>Here&#8217;s an example of how you could modify the `<strong>MovieRow</strong>` struct to achieve this:</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-435"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-swift github-light" data-language="swift" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">struct MovieRow</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #6f42c1;">View </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">var movie:</span><span class="token"> Movie</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">var body:</span><span class="token"> </span><span class="token" style="color: #d73a49;">some</span><span class="token"> View </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">GeometryReader</span><span class="token"> </span><span class="token">{</span><span class="token"> geometry </span><span class="token" style="color: #d73a49;">in</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">HStack</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">                </span><span class="token" style="color: #005cc5;">self</span><span class="token">.</span><span class="token">movie</span><span class="token">.</span><span class="token">posterImage</span><span class="token">
</span></span><span class="line"><span class="token">                    .</span><span class="token">resizable(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                    .</span><span class="token">aspectRatio(</span><span class="token">contentMode:</span><span class="token"> .</span><span class="token">fit</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                    .</span><span class="token">frame(</span><span class="token">width:</span><span class="token"> geometry.</span><span class="token" style="color: #005cc5;">size</span><span class="token">.</span><span class="token">width</span><span class="token"> </span><span class="token" style="color: #d73a49;">-</span><span class="token"> </span><span class="token" style="color: #005cc5;">20</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                </span><span class="token">Text(</span><span class="token" style="color: #005cc5;">self</span><span class="token">.</span><span class="token">movie</span><span class="token">.</span><span class="token">title</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                </span><span class="token">Spacer(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                </span><span class="token">Text(</span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">\(</span><span class="token" style="color: #005cc5;">self</span><span class="token" style="color: #032f62;">.</span><span class="token" style="color: #032f62;">movie</span><span class="token" style="color: #032f62;">.</span><span class="token" style="color: #032f62;">releaseYear</span><span class="token" style="color: #032f62;">)</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-438"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-436">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-437'
	>
	This answer is just right and something I wish I had had when I was learning about it. The example works like a charm.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-441"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-439">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-440'
	>
	Now, let’s see if it can help with transitioning from UIKit to SwiftUI.&nbsp;</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-444"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-442">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-443'
	>
	I provided a UIKit view and asked ChatGPT to convert it to SwiftUI. I&nbsp; honestly didn’t expect anything.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-447"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-445">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-446'
	>
	This is what I provided:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-449"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-swift github-light" data-language="swift" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">class WarningView</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #6f42c1;">UIView </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">func setText</span><span class="token">(</span><span class="token">_ text</span><span class="token">: </span><span class="token" style="color: #005cc5;">String</span><span class="token">)</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        label.</span><span class="token" style="color: #005cc5;">text</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> text
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token" style="color: #d73a49;">lazy</span><span class="token"> </span><span class="token">var warningImage:</span><span class="token"> UIImageView </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #d73a49;">let</span><span class="token"> imageView </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token">UIImageView(</span><span class="token">image:</span><span class="token"> UIImage.</span><span class="token">icWarning</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        imageView.</span><span class="token">translatesAutoresizingMaskIntoConstraints</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token" style="color: #005cc5;">false</span><span class="token">
</span></span><span class="line"><span class="token">        imageView.</span><span class="token">contentMode</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> .</span><span class="token">scaleAspectFit</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #d73a49;">return</span><span class="token"> imageView
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token" style="color: #d73a49;">lazy</span><span class="token"> </span><span class="token">var label:</span><span class="token"> UILabel </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #d73a49;">let</span><span class="token"> label </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token">UILabel(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        label.</span><span class="token">numberOfLines</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token" style="color: #005cc5;">0</span><span class="token">
</span></span><span class="line"><span class="token">        label.</span><span class="token">textColor</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> UIColor.</span><span class="token">black</span><span class="token">
</span></span><span class="line"><span class="token">        label.</span><span class="token">translatesAutoresizingMaskIntoConstraints</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token" style="color: #005cc5;">false</span><span class="token">
</span></span><span class="line"><span class="token">        label.</span><span class="token">font</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> UIFont.</span><span class="token">system(</span><span class="token">with:</span><span class="token"> </span><span class="token" style="color: #005cc5;">13</span><span class="token">, </span><span class="token">fontWeight:</span><span class="token"> .</span><span class="token">medium</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #d73a49;">return</span><span class="token"> label
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token" style="color: #d73a49;">lazy</span><span class="token"> </span><span class="token">var stackView:</span><span class="token"> UIStackView </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #d73a49;">let</span><span class="token"> stackView </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token">UIStackView(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        stackView.</span><span class="token">spacing</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token" style="color: #005cc5;">16</span><span class="token">
</span></span><span class="line"><span class="token">        stackView.</span><span class="token">axis</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> .</span><span class="token">horizontal</span><span class="token">
</span></span><span class="line"><span class="token">        stackView.</span><span class="token" style="color: #005cc5;">alignment</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> .</span><span class="token">top</span><span class="token">
</span></span><span class="line"><span class="token">        stackView.</span><span class="token">translatesAutoresizingMaskIntoConstraints</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> </span><span class="token" style="color: #005cc5;">false</span><span class="token">
</span></span><span class="line"><span class="token">        stackView.</span><span class="token">addArrangedSubview(</span><span class="token">warningImage</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        stackView.</span><span class="token">addArrangedSubview(</span><span class="token">label</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #d73a49;">return</span><span class="token"> stackView
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token" style="color: #d73a49;">override</span><span class="token"> </span><span class="token">func didMoveToSuperview</span><span class="token">(</span><span class="token">)</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #005cc5;">super</span><span class="token">.</span><span class="token">didMoveToSuperview(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">addSubview(</span><span class="token">stackView</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token" style="color: #005cc5;">self</span><span class="token">.</span><span class="token">backgroundColor</span><span class="token"> </span><span class="token" style="color: #d73a49;">=</span><span class="token"> .</span><span class="token">white</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">        NSLayoutConstraint.</span><span class="token">activate(</span><span class="token">[
</span></span><span class="line"><span class="token">            warningImage.</span><span class="token">widthAnchor</span><span class="token">.</span><span class="token">constraint(</span><span class="token">equalToConstant:</span><span class="token"> </span><span class="token" style="color: #005cc5;">24</span><span class="token">)</span><span class="token">,
</span></span><span class="line"><span class="token">            </span><span class="token">stackView.</span><span class="token">topAnchor</span><span class="token">.</span><span class="token">constraint(</span><span class="token">equalTo:</span><span class="token"> topAnchor</span><span class="token">, </span><span class="token">constant:</span><span class="token"> </span><span class="token" style="color: #005cc5;">16</span><span class="token">)</span><span class="token">,
</span></span><span class="line"><span class="token">            </span><span class="token">stackView.</span><span class="token">bottomAnchor</span><span class="token">.</span><span class="token">constraint(</span><span class="token">equalTo:</span><span class="token"> bottomAnchor</span><span class="token">, </span><span class="token">constant:</span><span class="token"> </span><span class="token" style="color: #005cc5;">-16</span><span class="token">)</span><span class="token">,
</span></span><span class="line"><span class="token">            </span><span class="token">stackView.</span><span class="token">leadingAnchor</span><span class="token">.</span><span class="token">constraint(</span><span class="token">equalTo:</span><span class="token"> leadingAnchor</span><span class="token">, </span><span class="token">constant:</span><span class="token"> </span><span class="token" style="color: #005cc5;">16</span><span class="token">)</span><span class="token">,
</span></span><span class="line"><span class="token">            </span><span class="token">stackView.</span><span class="token">trailingAnchor</span><span class="token">.</span><span class="token">constraint(</span><span class="token">equalTo:</span><span class="token"> trailingAnchor</span><span class="token">, </span><span class="token">constant:</span><span class="token"> </span><span class="token" style="color: #005cc5;">-16</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">]</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-452"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-450">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-451'
	>
	And this is what I got in return:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-454"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-swift github-light" data-language="swift" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">struct WarningView</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #6f42c1;">View </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">var text:</span><span class="token"> </span><span class="token" style="color: #005cc5;">String</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">var body:</span><span class="token"> </span><span class="token" style="color: #d73a49;">some</span><span class="token"> View </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">HStack(</span><span class="token">spacing:</span><span class="token"> </span><span class="token" style="color: #005cc5;">16</span><span class="token">)</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">Image(</span><span class="token">systemName:</span><span class="token"> </span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">exclamationmark.triangle</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                .</span><span class="token">resizable(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                .</span><span class="token">frame(</span><span class="token">width:</span><span class="token"> </span><span class="token" style="color: #005cc5;">24</span><span class="token">, </span><span class="token">height:</span><span class="token"> </span><span class="token" style="color: #005cc5;">24</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                .</span><span class="token">aspectRatio(</span><span class="token">contentMode:</span><span class="token"> .</span><span class="token">fit</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">Text(</span><span class="token">text</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                .</span><span class="token">font(</span><span class="token">.</span><span class="token">system(</span><span class="token">size:</span><span class="token"> </span><span class="token" style="color: #005cc5;">13</span><span class="token">, </span><span class="token">weight:</span><span class="token"> .</span><span class="token">medium</span><span class="token">)</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                .</span><span class="token">foregroundColor(</span><span class="token">.</span><span class="token">black</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                .</span><span class="token">lineLimit(</span><span class="token" style="color: #005cc5;">0</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">        .</span><span class="token">padding(</span><span class="token" style="color: #005cc5;">16</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        .</span><span class="token">background(</span><span class="token">Color.</span><span class="token">white</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-457"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-455">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-456'
	>
	This is mindblowing on so many levels. ChatGPT understands UIKit APIs and how the methods translate into UI. It correctly translates UIKit constraints into SwiftUI declaratively defined views with added frames, paddings, and spacings. This can be a great starting point for anyone transitioning from UIKit to the SwiftUI world.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-460"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-458">
	<h2	class='typography typography--size-52-default js-typography block-typography__typography'
	data-id='es-459'
	>
	Fixing bugs and problems</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-463"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-461">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-462'
	>
	Here comes the fun part. Let’s play with our favorites – bugs and pain points, and see if ChatGPT can address them correctly and help us out.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-466"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-464">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-465'
	>
	To start with, I chose one common mistake many rookies make in SwiftUI. They apply a frame modifier to an Image view, but it just won’t resize to the given frame.&nbsp;</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-469"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-467">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-468'
	>
	When starting out with SwiftUI, I always struggled with this part, so I wanted to see how long the chatbot would take to solve it.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-472"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-470">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-471'
	>
	I asked:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-475"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-473">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-474'
	>
	Why won&#8217;t my image be resized to 50&#215;50 with this code?</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-477"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-swift github-light" data-language="swift" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">HStack</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">    movie.</span><span class="token">posterImage</span><span class="token">
</span></span><span class="line"><span class="token">        .</span><span class="token">frame(</span><span class="token">width:</span><span class="token"> </span><span class="token" style="color: #005cc5;">50</span><span class="token">, </span><span class="token">height:</span><span class="token"> </span><span class="token" style="color: #005cc5;">50</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">Text(</span><span class="token">movie.</span><span class="token">title</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">Spacer(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">Text(</span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">\(</span><span class="token" style="color: #032f62;">movie.</span><span class="token" style="color: #032f62;">releaseYear</span><span class="token" style="color: #032f62;">)</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-480"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-478">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-479'
	>
	This is how ChatGPT responded:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-483"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-481">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-482'
	>
	<em>The `<strong>frame(width:height)</strong>` modifier sets the size of the view’s frame, but it does not affect the size of the view’s content. In this case, the `<strong>posterImage</strong>` view is not resized to fit within the frame, so it will be displayed in its original size. </em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-486"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-484">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-485'
	>
	<em>To resize the image to fit within the frame, you will need to use the `<strong>resizable()</strong>`modifier in combination with the `<strong>frame(width:height:)</strong>` modifier. The `<strong>resizable()</strong>`modifier adjusts the size of the view’s content to fit within the frame, while the `<strong>frame(width:height:)</strong>` modifier sets the size of the frame. </em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-489"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-487">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-488'
	>
	<em>Here’s how you can use these modifiers to resize the image to 50&#215;50:</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-491"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-swift github-light" data-language="swift" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">HStack</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">    movie.</span><span class="token">posterImage</span><span class="token">
</span></span><span class="line"><span class="token">        .</span><span class="token">resizable(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        .</span><span class="token">frame(</span><span class="token">width:</span><span class="token"> </span><span class="token" style="color: #005cc5;">50</span><span class="token">, </span><span class="token">height:</span><span class="token"> </span><span class="token" style="color: #005cc5;">50</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">Text(</span><span class="token">movie.</span><span class="token">title</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">Spacer(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">Text(</span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">\(</span><span class="token" style="color: #032f62;">movie.</span><span class="token" style="color: #032f62;">releaseYear</span><span class="token" style="color: #032f62;">)</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-494"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-492">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-493'
	>
	This answer is completely correct, and I really like the explanation. ChatGPT explains in detail why this approach is wrong and what SwiftUI does in the background. This particular issue is very hard to find in the official documentation, or it’s far less structured. When you’re learning about SwiftUI, ChatGPT’s answers are much more efficient and effective.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-497"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-495">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-496'
	>
	Learning any new technology can be painful at first, but SwiftUI is particularly known to have a steep learning curve. In the following example, I wanted to check whether ChatGPT can help. Building a UI, you’ll often want to create a screen on your own. It’s really hard to break the UI in SwiftUI, but I gave it my best shot. I tried to achieve a view with a yellow background and some text between two images, but I completely butchered it. So let’s see if ChatGPT can help me get back on track.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-500"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-498">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-499'
	>
	I asked:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-503"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-501">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-502'
	>
	Can you make this code work? I want to show vertically aligned text in between image views, and everything should have a yellow background.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-505"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-swift github-light" data-language="swift" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">struct ConfusingView</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #6f42c1;">View </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">var body:</span><span class="token"> </span><span class="token" style="color: #d73a49;">some</span><span class="token"> View </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">ZStack</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">Rectangle(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">Text(</span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">Mr. Worldwide</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">VStack</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">Image(</span><span class="token">systemName:</span><span class="token"> </span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">globe</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">Image(</span><span class="token">systemName:</span><span class="token"> </span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">globe</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-508"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-506">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-507'
	>
	The first solution it came up with didn’t quite work.</p></div>	</div>
</div>
</div>		</div>
	</div>

<div
	class="wrapper"
	data-id="es-513"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="wrapper__inner">
			<div class="block-media">
	<div	class="media block-media__media media__border--none media__align--center-center"
	data-id="es-511"
	 data-media-type='image'>

	<figure class="image block-media__image-figure image--size-stretch" data-id="es-512">
	<picture class="image__picture block-media__image-picture">
												<img
					src="https://infinum.com/uploads/2023/01/Fifth-Image-wrong-solution.webp"
					class="image__img block-media__image-img"
					alt=""
										height="2556"
															width="1179"
										loading="lazy"
					 />
					</picture>

	</figure></div></div>		</div>
	</div>

<div
	class="wrapper"
	data-id="es-608"
	 data-animation-target='inner-items'>
		
			<div class="wrapper__inner">
			<div class="block-blog-content js-block-blog-content">
	
<div class="block-blog-content-sidebar" data-id="es-514">
	

</div>

<div class="block-blog-content-main">
	
<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-517"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-515">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-516'
	>
	Maybe my requirements were not clear, so I tried correcting them.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-520"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-518">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-519'
	>
	This was my follow-up prompt:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-523"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-521">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-522'
	>
	I don&#8217;t want images horizontally aligned, I want them vertically aligned with text, so that one image is above the text and one is below.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-526"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-524">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-525'
	>
	This is the code ChatGPT provided:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-528"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-swift github-light" data-language="swift" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">struct ConfusingView</span><span class="token">:</span><span class="token"> </span><span class="token" style="color: #6f42c1;">View </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">var body:</span><span class="token"> </span><span class="token" style="color: #d73a49;">some</span><span class="token"> View </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">ZStack</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">Rectangle(</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                .</span><span class="token">foregroundColor(</span><span class="token">.</span><span class="token">yellow</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">VStack</span><span class="token"> </span><span class="token">{</span><span class="token">
</span></span><span class="line"><span class="token">                </span><span class="token">Image(</span><span class="token">systemName:</span><span class="token"> </span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">globe</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                </span><span class="token">Text(</span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">Mr. Worldwide</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">                </span><span class="token">Image(</span><span class="token">systemName:</span><span class="token"> </span><span class="token" style="color: #032f62;">&quot;</span><span class="token" style="color: #032f62;">globe</span><span class="token" style="color: #032f62;">&quot;</span><span class="token">)</span><span class="token">
</span></span><span class="line"><span class="token">            </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">        </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">}</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-531"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-529">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-530'
	>
	This is exactly what I wanted! The chatbot can add missing lines of code, adjust the existing ones and remove the unnecessary ones. When asked politely, it seems. In this case, it needed a little more explanation to perform what I intended, but it still feels unreal that it can do so in a matter of seconds.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-534"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-532">
	<h2	class='typography typography--size-52-default js-typography block-typography__typography'
	data-id='es-533'
	>
	Bonus: Fun with ChatGPT </h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-537"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-535">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-536'
	>
	Before we conclude this article, I wanted to test ChatGPT’s lyrical abilities using an absurd theme. So here’s a song about SwiftUI written by ChatGPT. Eminem, step down, there’s a new AI on the block. </p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-540"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-538">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-539'
	>
	<em>I&#8217;ve been coding for so long</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-543"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-541">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-542'
	>
	<em>With UIkit, it felt so wrong</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-546"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-544">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-545'
	>
	<em>But then I found a shining light</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-549"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-547">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-548'
	>
	<em>With SwiftUI, things felt just right</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-552"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-550">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-551'
	>
	<em>No more storyboards, no more fuss</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-555"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-553">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-554'
	>
	<em>Just simple code, that&#8217;s not a cuss</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-558"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-556">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-557'
	>
	<em>With modifiers and bindings too</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-561"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-559">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-560'
	>
	<em>This framework is really new</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-564"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-562">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-563'
	>
	<em>Chorus:</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-567"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-565">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-566'
	>
	<em>SwiftUI, SwiftUI</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-570"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-568">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-569'
	>
	<em>Making apps is a breeze</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-573"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-571">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-572'
	>
	<em>SwiftUI, SwiftUI</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-576"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-574">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-575'
	>
	<em>Making code is a breeze</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-579"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-577">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-578'
	>
	<em>It&#8217;s not just for iOS, it&#8217;s for Mac too</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-582"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-580">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-581'
	>
	<em>Apple&#8217;s future, it&#8217;s all brand new</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-585"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-583">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-584'
	>
	<em>With power of swift and UI design</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-588"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-586">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-587'
	>
	<em>We&#8217;ll build apps, that&#8217;s one of a kind</em></p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-591"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-589">
	<h2	class='typography typography--size-52-default js-typography block-typography__typography'
	data-id='es-590'
	>
	<strong>ChatGPT proves its worth</strong></h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-594"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-592">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-593'
	>
	We can all agree that this was fun and mind-boggling at the same time. Using ChatGPT in these scenarios feels like the future of coding and learning, and it can be deemed a pretty accurate source.&nbsp;</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-597"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-595">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-596'
	>
	The popular text generator is a great starting point and can definitely be your right hand when learning SwiftUI. On some occasions, it still requires previous knowledge of certain SwiftUI concepts so you can articulate your prompts correctly.&nbsp;</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-600"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-598">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-599'
	>
	However, ChatGPT really shines in explaining the code. When prompted to provide more thorough explanations, it gave detailed and correct responses for the most part.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-603"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-601">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-602'
	>
	Who knows, maybe it will be able to write articles reviewing its own work, such as this one, in the future.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-606"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-typography" data-id="es-604">
	<p	class='typography typography--size-16-text-roman js-typography block-typography__typography'
	data-id='es-605'
	>
	<em>If you are interested in going beyond ChatGTP and utilizing AI in your digital product, see <a href="https://infinum.com/artificial-intelligence/" id="https://infinum.com/artificial-intelligence/a" target="_blank" rel="noreferrer noopener">how we can help you on the way</a>.</em></p></div>	</div>
</div>
</div>		</div>
	</div><p>The post <a href="https://infinum.com/blog/learn-swiftui-with-chatgpt/">Using ChatGPT to Learn SwiftUI – Does It Work?</a> appeared first on <a href="https://infinum.com">Infinum</a>.</p>
]]>
				</content:encoded>
			</item>
		
	</channel>
</rss>