<?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 Chris Lee on Medium]]></title>
        <description><![CDATA[Stories by Chris Lee on Medium]]></description>
        <link>https://medium.com/@chris_khh?source=rss-53959b3cb369------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*e8iHIchJzfYk8A39tkhCKQ.jpeg</url>
            <title>Stories by Chris Lee on Medium</title>
            <link>https://medium.com/@chris_khh?source=rss-53959b3cb369------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 23:27:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chris_khh/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[#4 自選隨機繪製花卉圖疊疊樂]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/4-%E8%87%AA%E9%81%B8%E9%9A%A8%E6%A9%9F%E7%B9%AA%E8%A3%BD%E8%8A%B1%E5%8D%89%E5%9C%96%E7%96%8A%E7%96%8A%E6%A8%82-d38403a90e48?source=rss-53959b3cb369------2</link>
            <guid isPermaLink="false">https://medium.com/p/d38403a90e48</guid>
            <dc:creator><![CDATA[Chris Lee]]></dc:creator>
            <pubDate>Tue, 19 Dec 2023 07:39:00 GMT</pubDate>
            <atom:updated>2023-12-20T08:35:06.956Z</atom:updated>
            <content:encoded><![CDATA[<p>主題:<br>繪製梅花，7組花色／大小/位置，由random隨機配置<br>繪製小花，2組花色／大小/位置，由random隨機配置<br>繪製蜻蜓，大小/位置，由random隨機配置</p><p>二個頁面(主頁面選單：設定繪製內容及時間及顯示結果頁面)</p><p>練習 UIBezierPath() , CAShapeLayer() , CAGradientLayer(), Timer , random<br>練習頁面間的資料傳遞:多個 segue 共用一個 IBSegueAction+是否觸發 segue 切換頁面 shouldPerformSegue<br>運用 function , class , struct , enum , array , if , switch , guard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b3Z_ZUcqCkbV8TJatG5-Bg.png" /><figcaption>選單</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*TSizezawSjc2tWzRJ00Pbw.gif" /><figcaption>預設</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*ri5Sh61p6WsG0vbq3TgELA.gif" /><figcaption>自訂</figcaption></figure><p>問題一：參考 CAGradientLayer 漸層，發現無法由圓心向外漸層<br> 與是試作利用繪製多層圓形，每層顏色微調加上陰影，呈現了所想的效果。</p><pre>//搭陰影做漸層效果<br>    for i in 1...newLayerInfo.qty {<br>        flowerPath.removeAllPoints()<br>        newLayerInfo.radius = 40 - i<br>        <br>        newLayerInfo.fillColor = UIColor(red: CGFloat(flowerColors[colorIndex].r - (i * 5)) / 255, green: CGFloat(flowerColors[colorIndex].g - (i * 5)) / 255, blue: CGFloat(flowerColors[colorIndex].b - (i * 5)) / 255, alpha: CGFloat(flowerColors[colorIndex].a))<br>        <br>        newLayerInfo.strokeColor = newLayerInfo.fillColor<br>        newLayerInfo.shadowColor = newLayerInfo.fillColor<br>        <br>        flowerPath.addArc(withCenter: flowerView.center, radius: CGFloat(newLayerInfo.radius), startAngle: 0, endAngle: .pi / 180 * 360, clockwise: true)<br>        <br>        flowerView.addSubview(makeShapeLayerUIView(viewX: 0, viewY: 0, viewWidth: Int(flowerView.frame.width), viewHeight: Int(flowerView.frame.height), path: flowerPath, LayerInfo: newLayerInfo))<br>    }</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*-9Sb3nkz31lmpfl9vd-k1Q.png" /></figure><p>問題二: if 改成 guard 出現錯誤如下</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cBKPpSRdeLayPZ3_RtDVyg.png" /></figure><p>根據錯誤訊息，原來是要用 guard case。感謝Fix的幫助學習。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bLyOu-uBqTwa31XoOJlCSA.png" /></figure><p>GitHub:</p><p><a href="https://github.com/Chris-KHH/Flower">GitHub - Chris-KHH/Flower</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d38403a90e48" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/4-%E8%87%AA%E9%81%B8%E9%9A%A8%E6%A9%9F%E7%B9%AA%E8%A3%BD%E8%8A%B1%E5%8D%89%E5%9C%96%E7%96%8A%E7%96%8A%E6%A8%82-d38403a90e48">#4 自選隨機繪製花卉圖疊疊樂</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[#3 自畫像]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/3-%E8%87%AA%E7%95%AB%E5%83%8F-275ed1e74a9e?source=rss-53959b3cb369------2</link>
            <guid isPermaLink="false">https://medium.com/p/275ed1e74a9e</guid>
            <dc:creator><![CDATA[Chris Lee]]></dc:creator>
            <pubDate>Wed, 29 Nov 2023 07:15:49 GMT</pubDate>
            <atom:updated>2023-11-29T09:01:56.146Z</atom:updated>
            <content:encoded><![CDATA[<h3>運用SwiftUI ZStack (深度堆疊)，設計。</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*vbWEAcCXKzKpf2a0zbo8qg.png" /></figure><p>程式碼：</p><pre>import SwiftUI<br><br>struct ContentView: View {<br>    var body: some View {<br>        ZStack {<br><br>            Capsule() //頭髮<br>                .frame(width: 385, height: 600)<br>                .foregroundStyle(Color.black)<br>                .offset(y: 160)<br>            <br>            Ellipse() //臉<br>                .frame(width: 300, height: 300)<br>                .foregroundStyle(Color(CGColor(red: 251/255, green: 229/255, blue: 214/255, alpha: 1)))<br>                .offset(y: 60)<br><br>            Rectangle() //脖子<br>                .frame(width: 60, height: 100)<br>                .foregroundStyle(Color(CGColor(red: 251/255, green: 229/255, blue: 214/255, alpha: 1)))<br>                .offset(y: 240)<br>            <br>            Circle() //頭髮<br>                .trim(from: 0.5, to: 1)<br>                .frame(width: 370)<br>                .foregroundStyle(Color.black)<br>                .offset(y: 35)<br>            <br>            Rectangle() //頭髮分邊<br>                .trim(from: 0.5, to: 1)<br>                .frame(width: 12, height: 70)<br>                .foregroundStyle(Color(CGColor(red: 251/255, green: 229/255, blue: 214/255, alpha: 1)))<br>                .offset(x: -80)<br>                .rotationEffect(.degrees(-6))<br>            <br>            Ellipse() //帽子圓球<br>                .frame(width: 50, height: 50)<br>                .foregroundStyle(Color(CGColor(red: 200/255, green: 104/255, blue: 182/255, alpha: 1)))<br>                .offset(y: -220)<br>                .shadow(radius: 10)<br>            <br>            Ellipse() //帽子<br>              .trim(from: 0.5, to: 1)<br>              .frame(width: 375, height: 300)<br>              .foregroundStyle(Color(CGColor(red: 200/255, green: 104/255, blue: 182/255, alpha: 1)))<br>              .offset(y: -60)<br>              .shadow(radius: 10)<br>            <br>            Rectangle() //帽子反折<br>              .frame(width: 375, height: 80)<br>              .foregroundStyle(Color(CGColor(red: 200/255, green: 104/255, blue: 182/255, alpha: 1)))<br>              .offset(y: -30)<br>              .shadow(radius: 10)<br>                      <br>            Ellipse() //右眼<br>                .frame(width: 30, height: 30)<br>                .foregroundStyle(Color.black)<br>                .offset(x: -80,y: 70)<br>            <br>            Ellipse() //左眼<br>                .frame(width: 30, height: 30)<br>                .foregroundStyle(Color.black)<br>                .offset(x: 80,y: 70)<br>            <br>            //鼻子<br>            Rectangle()<br>                .frame(width: 25, height: 50)<br>                .foregroundStyle(Color(CGColor(red: 248/255, green: 203/255, blue: 173/255, alpha: 1)))<br>                .offset(x: -13,y: 120)<br>                .rotationEffect(.degrees(-5))<br>            Rectangle()<br>                .frame(width: 25, height: 50)<br>                .foregroundStyle(Color(CGColor(red: 251/255, green: 229/255, blue: 214/255, alpha: 1)))<br>                .offset(x: -11,y: 115)<br>                .rotationEffect(.degrees(-6))<br>            <br>            Circle() //嘴巴<br>                .trim(from: 0, to: 0.5)<br>                .stroke(Color.red, style: StrokeStyle(lineWidth: 8, lineCap: .round))<br>                .frame(width: 60)<br>                .offset(y: 345)<br>                .scaleEffect(y: 0.5)<br>        <br>            RoundedRectangle(cornerRadius: 70) //衣服<br>                 .foregroundStyle(Color(CGColor(red: 112/255, green: 48/255, blue: 160/255, alpha: 1)))<br>                .frame(width: 450, height: 400)<br>                .offset(y: 470)<br>           <br>            // 花朵上<br>            Ellipse()<br>                .frame(width: 20, height: 20)<br>                .foregroundStyle(Color(CGColor(red: 255/255, green: 255/255, blue: 121/255, alpha: 1)))<br>                .offset(x: 140,y: -110)<br>            Ellipse()<br>                .frame(width: 20, height: 20)<br>                .foregroundStyle(Color(CGColor(red: 255/255, green: 255/255, blue: 121/255, alpha: 1)))<br>                .offset(x: 132,y: -126)<br>            Ellipse()<br>                .frame(width: 20, height: 20)<br>                .foregroundStyle(Color(CGColor(red: 255/255, green: 255/255, blue: 121/255, alpha: 1)))<br>                .offset(x: 115,y: -125)<br>            Ellipse()<br>                .frame(width: 20, height: 20)<br>                .foregroundStyle(Color(CGColor(red: 255/255, green: 255/255, blue: 121/255, alpha: 1)))<br>                .offset(x: 110,y: -110)<br>            Ellipse()<br>                .frame(width: 20, height: 20)<br>                .foregroundStyle(Color(CGColor(red: 255/255, green: 255/255, blue: 121/255, alpha: 1)))<br>                .offset(x: 125,y: -99)<br>            <br>            // 花朵下<br>            Ellipse()<br>                .frame(width: 20, height: 20)<br>                .foregroundStyle(Color(CGColor(red: 255/255, green: 255/255, blue: 121/255, alpha: 1)))<br>                .offset(x: 180,y: 380)<br>            Ellipse()<br>                .frame(width: 20, height: 20)<br>                .foregroundStyle(Color(CGColor(red: 255/255, green: 255/255, blue: 121/255, alpha: 1)))<br>                .offset(x: 172,y: 364)<br>            Ellipse()<br>                .frame(width: 20, height: 20)<br>                .foregroundStyle(Color(CGColor(red: 255/255, green: 255/255, blue: 121/255, alpha: 1)))<br>                .offset(x: 155,y: 365)<br>            Ellipse()<br>                .frame(width: 20, height: 20)<br>                .foregroundStyle(Color(CGColor(red: 255/255, green: 255/255, blue: 121/255, alpha: 1)))<br>                .offset(x: 150,y: 380)<br>            Ellipse()<br>                .frame(width: 20, height: 20)<br>                .foregroundStyle(Color(CGColor(red: 255/255, green: 255/255, blue: 121/255, alpha: 1)))<br>                .offset(x: 165,y: 391)<br>            <br>        }<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=275ed1e74a9e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/3-%E8%87%AA%E7%95%AB%E5%83%8F-275ed1e74a9e">#3 自畫像</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[#1 用 view 拼湊漂亮的圖案]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/1-%E7%94%A8-view-%E6%8B%BC%E6%B9%8A%E6%BC%82%E4%BA%AE%E7%9A%84%E5%9C%96%E6%A1%88-9d24d72c9e98?source=rss-53959b3cb369------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d24d72c9e98</guid>
            <dc:creator><![CDATA[Chris Lee]]></dc:creator>
            <pubDate>Mon, 20 Nov 2023 05:25:17 GMT</pubDate>
            <atom:updated>2023-11-20T07:14:18.311Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>構圖來源：利用 32x32 icon圖共1024方塊製作</strong></p><p><strong>目的：</strong></p><p>1。利用view的上層覆蓋下層之堆疊特性。完成圖共使用147個View。</p><p>2。練習快捷鍵，減少滑鼠使用。</p><p>除view Background修改，使用滑鼠外，全由鍵盤完成。</p><p><strong>做法：</strong></p><p>1。cmd + shift + n： 建立新專案</p><p>2。cmd + shift + L： 產生一個superview，做為一張設計圖的容器。</p><p>3。cmd + shift + L： 產生一個subview 10*10point，即1：10比例。</p><p>4。開始製圖：重覆以下動作</p><p>cmd + d：copy paste subview ─〉cmd + option + 5</p><p>─〉滑鼠點選Background 修改RGB ─〉cmd + option + 6</p><p>─〉直接輸入X/Y/Width/Height</p><p>cmd + d：copy paste subview ─〉cmd + option + 5 ─〉cmd + option + 6</p><p>─〉直接輸入X/Y/Width/Height</p><p>5。cmd + R ─〉App 畫面截圖 產生 1024x1024 的圖片</p><p>─〉設定成 App Icon。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*L33jQVO_dNK54Y-OTGzEug.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gmF81tXBmSOBc_Y3K8n_Yw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d24d72c9e98" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/1-%E7%94%A8-view-%E6%8B%BC%E6%B9%8A%E6%BC%82%E4%BA%AE%E7%9A%84%E5%9C%96%E6%A1%88-9d24d72c9e98">#1 用 view 拼湊漂亮的圖案</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>