<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Samantha Chang on Medium]]></title>
        <description><![CDATA[Stories by Samantha Chang on Medium]]></description>
        <link>https://medium.com/@SamanthaChang?source=rss-cf815791fdc3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UWoWIBc5BRLdKAa4Sg7seQ.jpeg</url>
            <title>Stories by Samantha Chang on Medium</title>
            <link>https://medium.com/@SamanthaChang?source=rss-cf815791fdc3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 22:32:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@SamanthaChang/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Assignment#5: 從Playground調色去背圖片]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/assignment-5-%E5%BE%9Eplayground%E8%AA%BF%E8%89%B2%E5%8E%BB%E8%83%8C%E5%9C%96%E7%89%87-4e42bac8808?source=rss-cf815791fdc3------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e42bac8808</guid>
            <dc:creator><![CDATA[Samantha Chang]]></dc:creator>
            <pubDate>Wed, 12 Apr 2023 00:49:51 GMT</pubDate>
            <atom:updated>2023-04-13T10:21:42.656Z</atom:updated>
            <content:encoded><![CDATA[<p>這篇文章用來記錄如何在playground中以程式碼更改圖片的顏色。</p><blockquote><strong>步驟說明</strong></blockquote><ol><li>準備一張去背的圖片。</li><li>匯入playground的resources</li><li>先以中文思考程式執行的步驟</li><li>轉譯成程式碼</li></ol><blockquote><strong>步驟解說</strong></blockquote><ol><li>準備好一張去背的圖片</li></ol><p>這個練習我使用的圖片是一張運動防護員 (Athletic Trainer) 的人物icon，目標是利用程式碼更換衣服的顏色。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*x2V_0QzHcP46Oy7d2TeTOw.png" /><figcaption>原始圖片</figcaption></figure><p>首先，在mac內建的Picture Preview中點選Markup Toolbar&gt;Instant Alpha，在目標的去背範圍拖曳滑鼠，將去背的區塊圈選下來後，在工具列中選擇cut，去除原來圖片的顏色，並且確認儲存為png檔。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c94Npyt6NV2xWXmusktNcQ.png" /><figcaption>去除衣服的顏色</figcaption></figure><p>2. 匯入playground的resources</p><p>直接把圖片拖曳到playground左側的resources，並把檔名命名為AT uniform。</p><p>3. 先以中文思考程式執行的步驟</p><pre>//匯入UIKit的函式庫<br>//宣告一個常數atImage，定義他的型別為UIImage，名稱填入之前丟到resources的圖片名稱AT uniform<br>//宣告一個常數atImageView，傳入UIImage的圖片資訊（我們看到的圖片）<br>//給指令，設定atImageView的背景顏色（更換衣服的顏色）</pre><p>4. 轉譯成程式碼</p><pre>import UIKit<br><br>let atImage = UIImage(named: “AT uniform”)<br>let atImageView = UIImageView(image: atImage)<br>atImageView.backgroundColor = UIColor (red: 127/255, green: 0/255, blue: 2/255, alpha: 1)</pre><p>成果</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u-9t-0ezSQSw5r8z4KVQEw.png" /><figcaption>換衣服囉</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e42bac8808" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/assignment-5-%E5%BE%9Eplayground%E8%AA%BF%E8%89%B2%E5%8E%BB%E8%83%8C%E5%9C%96%E7%89%87-4e42bac8808">Assignment#5: 從Playground調色去背圖片</a> was originally published in <a href="https://medium.com/peter-pan-swift-ios-class">彼得潘的 Swift iOS / Flutter App 開發教室</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assignment#04: variable and constant coding practice]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/assignment-04-variable-and-constant-coding-practice-387205531e4?source=rss-cf815791fdc3------2</link>
            <guid isPermaLink="false">https://medium.com/p/387205531e4</guid>
            <dc:creator><![CDATA[Samantha Chang]]></dc:creator>
            <pubDate>Tue, 28 Mar 2023 10:57:26 GMT</pubDate>
            <atom:updated>2023-04-04T11:20:36.942Z</atom:updated>
            <content:encoded><![CDATA[<p>雖然之前玩playgrounds的時候有練習過宣告變數和常數，但跟用來寫題目的感覺不太一樣。Peter特別提醒等號在程式碼裡的意義，並不是說明等號兩邊的值相等，而是把等號右邊的程式碼儲存到左邊，這一點我覺得在理解程式碼上非常受用。</p><p>這篇文章就簡單記錄一下宣告常數和變數的練習，並且利用ChatGPT檢查自己的程式碼。</p><h3>Sum</h3><p>You are given two variables a and b, compute their sum and store it in another variable named sum then print the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YISmyVR9vPFoyRGCu7dVSg.png" /></figure><h3>Seconds</h3><p>Determine the number of seconds in a year and store the number in a variable named secondsInAYear</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eo4psUqwv4MWSsfK5b-BEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DgEuO_4DvxdW60WulSxNyQ.png" /></figure><h3>Pixels</h3><p>Your are given the width and height of a screen in pixels. Calculate the total number of pixels on the screen and store the result in a variable named numberOfPixels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aCFTIAkBS28eO75JYe8QNg.png" /></figure><h3>Sum and Difference</h3><p>You are given the sum and the difference of two numbers. Find out the values of the original numbers and store them in variables a and b.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-RPvd9Ueqi2ic9h_RNj7hA.png" /></figure><h3>L Area</h3><p>You are given four variables width, height, x, y that describe the dimensions of a L-shape as shown in the image below. Determine the perimeter and area of the described L-shape. Store the value of the perimeter in a variable named perimeter, and the area in a variable named area.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*REU9OILEDZBiLSke7hHTDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iMsJfxaCEFHuyQPTuxE6UQ.png" /></figure><h3>Swap</h3><p>Given two variable a and b, swap their values. That is the new value of a will become the old value of b and vice versa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hFwpHt2OdyJUAP7X5YmYpA.png" /></figure><p>請AI幫忙檢查程式碼後獲得更簡潔的寫法：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-JBtgVHdIdAmv-Urj87z_A.png" /></figure><h3>Last digit</h3><p>You are given a number a. Print the last digit of a.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FmcEUmKycDF9fuCXWOGjpw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BUKA6ARKjGwVShFejxmDjg.png" /></figure><h3>Dog Years</h3><p>You are given Rocky’s age in dog years. Print Rocky’s age in human years. You know that 1 human year is 7 dog years.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HHVAhjrWZIH7aNWPOEV0YA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ONJL8R7pERDrxHNOub7QQQ.png" /></figure><h3>Brothers</h3><p>Everyone hates solving word problems by hand so let’s make a program to solve them for us.<br>x years from now Alice will be y times older than her brother Bob. Bob is 12years old. How many years does Alice have?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XeBXhDP8putpDmSt5fSmdA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fqx2tyJ1V8RAjkG_UnIjYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_JwQQv4wP7qHVZ5o8n1oig.png" /><figcaption>AI建議要寫出印出的程式碼</figcaption></figure><h3>Apples and Oranges</h3><p>You have x apples. Bob trades 3 oranges for 5 apples. He does not accept trades with cut fruit.<br>How many oranges can you get from Bob and how many apples will you have left?</p><p>The number of apples you will have left should be stored in a variable named apples. The number of oranges you will have after the trade should be stored in a variable named oranges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QEnRVsQSgOpPNsFWOuYN2A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yKkOEZTyErZON2HIU3_PgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XloF10L0bktrhHX-s0JWvQ.png" /><figcaption>被AI提醒要修改命名的文法</figcaption></figure><h3>Boys and Girls</h3><p>A class consists of numberOfBoys boys and numberOfGirls girls.<br>Print the percentage of boys in the class followed by the percentage of girls in the class. The percentage should be printed rounded down to the nearest integer. For example 33.333333333333 will be printed as 33.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*muo2dje71oiuIINRFCjCFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hCQEgD4y4LrEWGK_nm8q5w.png" /><figcaption>AI提供的建議</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YBeqnV7UV1o7tu9yxhg7vA.png" /><figcaption>好的，文組生覺得頭很痛</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=387205531e4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/assignment-04-variable-and-constant-coding-practice-387205531e4">Assignment#04: variable and constant coding practice</a> was originally published in <a href="https://medium.com/peter-pan-swift-ios-class">彼得潘的 Swift iOS / Flutter App 開發教室</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assignment#02: Draw image with image views]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/assignment-02-draw-image-with-image-views-18218aa2103d?source=rss-cf815791fdc3------2</link>
            <guid isPermaLink="false">https://medium.com/p/18218aa2103d</guid>
            <dc:creator><![CDATA[Samantha Chang]]></dc:creator>
            <pubDate>Sat, 11 Mar 2023 07:48:00 GMT</pubDate>
            <atom:updated>2023-03-12T05:41:52.923Z</atom:updated>
            <content:encoded><![CDATA[<p>為了更熟悉Xcode的座標系統（Points），這個練習的目標是將View擺放在正確的位置來顯示圖案。</p><p>首先，我找了一張瑪利歐的圖片，並且在正式使用Xcode繪圖前，先利用google sheet的格線畫草稿。步驟如下：</p><p>1) 將所有的cells調整成20*20的大小<br>2) 確認底圖的尺寸為19*31（等下設定Superview的參考）<br>3) 填上色塊並註記色號<br>4) 標示座標</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9YgvbMGeENOcocB-5fNTRQ.png" /></figure><p>草圖畫完之後就正式在Xcode上作畫。為了之後可以微調瑪利歐在畫面上的位置，所以我在view的階層之下再建立一個super view當作底圖，並且把它命名為Mario background。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LWurUwGJUHa3pczx2I3PiA.png" /></figure><p>接著，在subview建立一個20*20的view，按照在google sheet上確認好的座標，將每一顆view擺放到目標的位置。因為一顆一顆放太慢了，所以後來有部分的view我調整了width和height來節省時間。</p><p>成品在模擬器上看起來是這樣：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gsmxr7_WJ-dAamLC4Y1okg.png" /></figure><p>最後，找一張適合當作icon的圖，將像素調整成1024*1024，丟到Assets裡設定成App的icon。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0u4imEk0h-qveB1xxyq3PQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*3lDKIG278-lleUoWBfPAmA.gif" /></figure><p>GitHub連結：</p><p><a href="https://github.com/Olvidarte/Super-Mario">GitHub - Olvidarte/Super-Mario</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18218aa2103d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/assignment-02-draw-image-with-image-views-18218aa2103d">Assignment#02: Draw image with image views</a> was originally published in <a href="https://medium.com/peter-pan-swift-ios-class">彼得潘的 Swift iOS / Flutter App 開發教室</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Something about me]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/something-about-me-75b274567ecd?source=rss-cf815791fdc3------2</link>
            <guid isPermaLink="false">https://medium.com/p/75b274567ecd</guid>
            <dc:creator><![CDATA[Samantha Chang]]></dc:creator>
            <pubDate>Wed, 08 Mar 2023 10:03:09 GMT</pubDate>
            <atom:updated>2023-03-08T14:56:10.156Z</atom:updated>
            <content:encoded><![CDATA[<p>每一次介紹自己好像都需要從靈魂深處翻找足以代表自己的元素。仔細回望過去，似乎人生經歷的每個階段都僅僅只是我滿足好奇心的一部分，沒有哪一個身份可以完整地詮釋我。</p><p>即使不那麼吻合主流的社會框架也無所謂，珍惜每一個當下的喜歡，所有懷抱好奇與興趣的事，我都要一點一點地靠近。</p><p>—</p><p>如果我有足夠的天份再現我不曾見過的世界，也許我會成為歷史研究者。<br>我有耐著孤獨自己一人爬梳過去的耐心和把握嗎？我沒有。<br>所以，很可惜，我只能成為一個喜歡歷史的人。</p><p>如果我有挑戰未知的企圖心，也許我會成為運動醫學研究領域的追尋者。<br>面對可能找不到答案的問題，我有自信堅持到底嗎？我沒有。<br>所以，很遺憾，我只能在臨床的世界裡做我有把握的決策。</p><p>如果給我一些時間，讓我確認我心底的聲音，<br>我有信心對我的喜歡和選擇負責，並且可以一直執著下去嗎？可以。<br>所以，是的，這一次我要進入程式語言的世界了。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75b274567ecd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/something-about-me-75b274567ecd">Something about me</a> was originally published in <a href="https://medium.com/peter-pan-swift-ios-class">彼得潘的 Swift iOS / Flutter App 開發教室</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>