<?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 Winnie on Medium]]></title>
        <description><![CDATA[Stories by Winnie on Medium]]></description>
        <link>https://medium.com/@ji3g4vic03?source=rss-1344ea432c45------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*NMIHCZlx2ts12o7F</url>
            <title>Stories by Winnie on Medium</title>
            <link>https://medium.com/@ji3g4vic03?source=rss-1344ea432c45------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 11:48:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ji3g4vic03/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[＃19製作特別的圖片（playground）]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/19%E8%A3%BD%E4%BD%9C%E7%89%B9%E5%88%A5%E7%9A%84%E5%9C%96%E7%89%87-playground-5dae14d61d8?source=rss-1344ea432c45------2</link>
            <guid isPermaLink="false">https://medium.com/p/5dae14d61d8</guid>
            <dc:creator><![CDATA[Winnie]]></dc:creator>
            <pubDate>Thu, 27 Apr 2023 07:24:01 GMT</pubDate>
            <atom:updated>2023-04-28T15:42:08.780Z</atom:updated>
            <content:encoded><![CDATA[<p>☀︎成品：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JJvgAcenXv3TtP1hIjW9oA.png" /></figure><pre>import UIKit<br>//加入圖片<br>let sunImage = UIImage(named: &quot;sun.jpg&quot;)<br>let handImage = UIImage(named: &quot;hand.png&quot;)<br>let sunView = UIImageView(image: sunImage)<br>let handView = UIImageView(image: handImage)<br>//設定文字框架大小<br>let messageLabel = UILabel(frame: CGRect(x: 450, y: 200, width: 1000, height: 500))<br>messageLabel.text = &quot;落日餘暉&quot;<br>//文字顏色<br>messageLabel.textColor = UIColor(red: 255/255, green: 193/255, blue: 100/255, alpha: 1)<br>//文字大小<br>messageLabel.font = UIFont.systemFont(ofSize: 150)<br>sunView.addSubview(messageLabel)<br>//邊框寬度及顏色<br>sunView.layer.borderWidth = 7<br>sunView.layer.borderColor = CGColor(red: 0, green: 200/255, blue: 200/255, alpha: 0.5)<br>//設定圓角<br>sunView.layer.cornerRadius = 50<br>sunView.clipsToBounds = true<br><br>//維持圖片比例且填滿<br>handView.contentMode = .scaleAspectFill<br>//調整view大小<br>handView.frame = CGRect(x: 400, y: 1300, width: 700, height: 700)<br>//日落中加入剪影<br>sunView.addSubview(handView)</pre><p>☀︎練習項目：如上</p><p>☀︎︎成品：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*H_p6XQ2A0_-F7TSwP6RIvg.png" /></figure><pre>//加入圖片<br>let sunImage = UIImage(named: &quot;sun.jpg&quot;)<br>let handImage = UIImage(named: &quot;hand.png&quot;)<br>let sunView = UIImageView(image: sunImage)<br>let handView = UIImageView(image: handImage)<br>//維持圖片比例且填滿<br>handView.contentMode = .scaleAspectFill<br>//.frame調整大小位置<br>handView.frame = CGRect(x: 0, y: 50, width: 1500, height: 2000)<br>//sun的遮罩為剪影圖<br>sunView.mask = handView<br>//透明度<br>sunView.alpha = 0.7<br>//圓角<br>sunView.layer.cornerRadius = 50<br>sunView.clipsToBounds = true</pre><p>☀︎練習項目：使用Mask</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5dae14d61d8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/19%E8%A3%BD%E4%BD%9C%E7%89%B9%E5%88%A5%E7%9A%84%E5%9C%96%E7%89%87-playground-5dae14d61d8">＃19製作特別的圖片（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[＃18互動式結局storyboard&segue]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/18%E4%BA%92%E5%8B%95%E5%BC%8F%E7%B5%90%E5%B1%80storyboard-segue-a0d0d19a8270?source=rss-1344ea432c45------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0d0d19a8270</guid>
            <dc:creator><![CDATA[Winnie]]></dc:creator>
            <pubDate>Tue, 18 Apr 2023 01:38:59 GMT</pubDate>
            <atom:updated>2023-04-18T08:50:20.952Z</atom:updated>
            <content:encoded><![CDATA[<p>☀︎成品：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*xoReoiAGPdglbQ36l2oyYg.gif" /></figure><p>☀︎練習項目（熟悉storyboard使用）：<br>1.LaunchScreen<br>2.storyboard&amp;segue</p><p>☀︎製作：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*I76-UDJAkfRScdBn1-LzAQ.png" /></figure><p>☀︎GitHub: <a href="https://github.com/ji3g4vic/chooseStory">https://github.com/ji3g4vic/chooseStory</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0d0d19a8270" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/18%E4%BA%92%E5%8B%95%E5%BC%8F%E7%B5%90%E5%B1%80storyboard-segue-a0d0d19a8270">＃18互動式結局storyboard&amp;segue</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[#17電子書app2_教材收集樣板]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/17%E9%9B%BB%E5%AD%90%E6%9B%B8app2-%E6%95%99%E6%9D%90%E6%94%B6%E9%9B%86%E6%A8%A3%E6%9D%BF-4c8334ddcaec?source=rss-1344ea432c45------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c8334ddcaec</guid>
            <dc:creator><![CDATA[Winnie]]></dc:creator>
            <pubDate>Tue, 04 Apr 2023 08:50:25 GMT</pubDate>
            <atom:updated>2023-04-04T10:42:11.305Z</atom:updated>
            <content:encoded><![CDATA[<p>☀︎成品：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*OC2dtlS6mHg_mI27Whpqhg.gif" /></figure><p>☀︎練習項目：<br>1.segue 串接頁面<br>2.搭配 tab bar controller &amp; navigation controller<br>3.Scroll View配合contentSize滑動應用</p><p>☀︎設計想法：<br>將平常工作時喜歡使用或是好用的教材做整理，一方面可以將想到的教案做一個記錄，隨時可以調整應用在課程中，一方面可以與其他家長或是治療師分享使用。此次主要再次熟練xcode功能以外（之前都對照著別人的作業或範本一步驟一步驟調整，這次在做的時候有些功能使用上已經比較快速），也為以後先做一個初版的樣子。</p><p>☀︎製作：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*QyKeDnE4fEj1zHYARSgWrw.png" /></figure><p>🌟點擊圖片跳轉（將Button放在圖片下面）<br>🌟Scroll View要設定contentSize（根據左右或上下滑調整x或y值）</p><p>☀︎GitHub:</p><p><a href="https://github.com/ji3g4vic/teachingAids">https://github.com/ji3g4vic/teachingAids</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c8334ddcaec" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/17%E9%9B%BB%E5%AD%90%E6%9B%B8app2-%E6%95%99%E6%9D%90%E6%94%B6%E9%9B%86%E6%A8%A3%E6%9D%BF-4c8334ddcaec">#17電子書app2_教材收集樣板</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[#16餐費換算app]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/16%E9%A4%90%E8%B2%BB%E6%8F%9B%E7%AE%97app-36944234c381?source=rss-1344ea432c45------2</link>
            <guid isPermaLink="false">https://medium.com/p/36944234c381</guid>
            <dc:creator><![CDATA[Winnie]]></dc:creator>
            <pubDate>Sun, 19 Mar 2023 14:02:30 GMT</pubDate>
            <atom:updated>2023-03-20T14:39:38.886Z</atom:updated>
            <content:encoded><![CDATA[<p>☀成品：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*OYhs9E-g9jrQn3TL2w2tkQ.gif" /></figure><p>☀︎主要練習項目：<br>1.字串轉數字<br>2.設定數字鍵盤（可收起）</p><p>☀︎設計想法：<br>大部分看到的都是將餐費作為均分的設計，不過自己和朋友出門吃飯時，大多是將自己的費用加上服務費轉給付錢的人，因此想要設計可以算出每個人的價格，然後首頁會自動加成這單的總金額給付錢的人核對總金額是否正確。<br>⚠️ 想法很美好不過技術還不允許，所以這是一個半成品。<br>Problem1:<br>• 產生的分頁無法寫程式 →新增類別並繼承Cocoa Touch. framework<br>參考：<a href="https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E5%95%8F%E9%A1%8C%E8%A7%A3%E7%AD%94%E9%9B%86/%E6%96%B0%E5%A2%9E-cocoa-touch-class-%E7%9A%84%E6%AD%A5%E9%A9%9F%E8%AA%AA%E6%98%8E-5601a0b2ed3b">https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E5%95%8F%E9%A1%8C%E8%A7%A3%E7%AD%94%E9%9B%86/%E6%96%B0%E5%A2%9E-cocoa-touch-class-%E7%9A%84%E6%AD%A5%E9%A9%9F%E8%AA%AA%E6%98%8E-5601a0b2ed3b</a></p><p>Problem2:（找了資料試了一下還是不太懂如何使用，學習完再來補上）<br>• 每位個人的金額回傳至總金額相加 →protocol&amp;delegate應用<br>參考：<br><a href="https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E5%95%8F%E9%A1%8C%E8%A7%A3%E7%AD%94%E9%9B%86/%E5%88%A9%E7%94%A8-delegate-%E8%AE%93%E4%B8%8D%E5%90%8C%E5%85%83%E4%BB%B6%E6%BA%9D%E9%80%9A-%E4%BB%A5%E8%B3%87%E6%96%99%E5%9B%9E%E5%82%B3%E5%88%B0%E5%89%8D%E4%B8%80%E9%A0%81-controller-%E7%82%BA%E4%BE%8B-ba215f3d2596">https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E5%95%8F%E9%A1%8C%E8%A7%A3%E7%AD%94%E9%9B%86/%E5%88%A9%E7%94%A8-delegate-%E8%AE%93%E4%B8%8D%E5%90%8C%E5%85%83%E4%BB%B6%E6%BA%9D%E9%80%9A-%E4%BB%A5%E8%B3%87%E6%96%99%E5%9B%9E%E5%82%B3%E5%88%B0%E5%89%8D%E4%B8%80%E9%A0%81-controller-%E7%82%BA%E4%BE%8B-ba215f3d2596</a></p><p>☀︎製作流程：</p><ol><li>textField屬性設定：</li></ol><p>⭐︎ clear button為輸入時旁邊可以消除的叉叉</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*SaSwtUfU3lo32riOClR8jA.png" /></figure><p>⭐︎預設鍵盤為輸入number的</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*KkWBxYFecgf7XGyGR3lCnA.png" /></figure><p>2.func設定：(主要分為計算和清除)</p><p>⭐︎計算：<br>• 首先resignFirstResponder()為輸入完畢時，能夠關閉鍵盤<br>• if為未輸入空字串時則顯示為0，else的部分則先計算小費後，再將小費跟原<br> 價格相加，作為個人的價格。<br>（參考：<a href="https://ithelp.ithome.com.tw/articles/10220888">https://ithelp.ithome.com.tw/articles/10220888</a><a href="https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E6%95%99%E5%AE%A4/22-%E6%8F%9B%E7%AE%97app-%E5%A4%9A%E4%BA%BA%E5%88%86%E6%94%A4%E8%A8%88%E7%AE%97%E6%A9%9F-c8c589030643">https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E6%95%99%E5%AE%A4/22-%E6%8F%9B%E7%AE%97app-%E5%A4%9A%E4%BA%BA%E5%88%86%E6%94%A4%E8%A8%88%E7%AE%97%E6%A9%9F-c8c589030643</a>）</p><pre> @IBAction func calculateButton(_ sender: Any) {<br>        mealPrice.resignFirstResponder()<br>        serviceCharge.resignFirstResponder()<br>        if mealPrice.text == &quot;&quot; || serviceCharge.text == &quot;&quot;{<br>            mealPrice.text = &quot;0&quot;<br>            serviceCharge.text = &quot;0&quot;<br>        }else{<br>                let tip = Double(mealPrice.text!)! * Double(serviceCharge.text!)! / 100<br>                let price = Double(mealPrice.text!)! + tip<br>                <br>                individualPrice.text = String(price) + &quot;元&quot;<br>                <br>            }<br>        }</pre><p>⭐︎清除：</p><ul><li>按下清除後，顯示空字串及0元</li></ul><pre>    @IBAction func clearButton(_ sender: Any) {<br>        <br>        mealPrice.text = &quot;&quot;<br>        serviceCharge.text = &quot;&quot;<br>        individualPrice.text = &quot;0元&quot;<br>    }</pre><p>最後附上GitHub網址：</p><pre>import UIKit<br><br>class peopleOneViewController: UIViewController {<br><br>    <br>    @IBOutlet weak var mealPrice: UITextField!<br>    @IBOutlet weak var serviceCharge: UITextField!<br>    @IBOutlet weak var individualPrice: UILabel!<br><br>    <br>    override func viewDidLoad() {<br>        super.viewDidLoad()<br>       <br>        mealPrice.keyboardType = .numberPad<br>        serviceCharge.keyboardType = .numberPad<br><br>        // Do any additional setup after loading the view.<br>    }<br>    <br>    @IBAction func calculateButton(_ sender: Any) {<br>        mealPrice.resignFirstResponder()<br>        serviceCharge.resignFirstResponder()<br>        if mealPrice.text == &quot;&quot; || serviceCharge.text == &quot;&quot;{<br>            mealPrice.text = &quot;0&quot;<br>            serviceCharge.text = &quot;0&quot;<br>        }else{<br>                let tip = Double(mealPrice.text!)! * Double(serviceCharge.text!)! / 100<br>                let price = Double(mealPrice.text!)! + tip<br>                <br>                individualPrice.text = String(price) + &quot;元&quot;<br>                <br>            }<br>        }<br><br>    @IBAction func clearButton(_ sender: Any) {<br>        <br>        mealPrice.text = &quot;&quot;<br>        serviceCharge.text = &quot;&quot;<br>        individualPrice.text = &quot;0元&quot;<br>    }</pre><p><a href="https://github.com/ji3g4vic/mealCalculate-undone-">https://github.com/ji3g4vic/mealCalculate-undone-</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36944234c381" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/16%E9%A4%90%E8%B2%BB%E6%8F%9B%E7%AE%97app-36944234c381">#16餐費換算app</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[＃15 if else 練習｜點餐]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/15-if-else-%E7%B7%B4%E7%BF%92-%E9%BB%9E%E9%A4%90-7bafbf538bc3?source=rss-1344ea432c45------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bafbf538bc3</guid>
            <dc:creator><![CDATA[Winnie]]></dc:creator>
            <pubDate>Fri, 17 Feb 2023 03:27:44 GMT</pubDate>
            <atom:updated>2023-02-17T03:56:26.317Z</atom:updated>
            <content:encoded><![CDATA[<p>☀︎主要練習項目：<br>1.SegmentControl<br>2.Switch<br>3.Slider<br>4.if else配合以上內容<br>5.Text View呈現結果<br>6.review Scroll View</p><p>☀︎成品：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*uPuu4FlJ2AjSy0OeLOKmzw.gif" /></figure><h4>1.建立IBOutlet</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JsnA7gKjN35D9yQbOCeYhA.png" /><figcaption>(先將會使用到的部分拉出來)</figcaption></figure><h4>2.拉出IBAction</h4><p>🌟記得要先為選項設立一個變數，好讓字串可以存在裡面</p><pre>    var baseSet = &quot;嫩萵苣&quot;<br>    var mainSet = &quot;舒肥雞胸&quot;<br>    var sauceSet = &quot;手作醬料&quot;<br>    var noodleSet = &quot;天使冷麵&quot;</pre><p>☼ SegmentControl</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PK5XX5R3Tb3HiByeov1B4A.png" /></figure><p>☼ Switch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*R9APvjhah4nHhpi4Fu1PjQ.png" /><figcaption>關閉則代表不要所以設空字串</figcaption></figure><p>☼Slider(隨移動改變旁邊label，slider大小設定為5~10)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JyoZ2Gujsmzn2w73sVBuiQ.png" /></figure><p>☼按下Button後TextView顯示結果</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TD-TtlzccOHs2nvRTpeawQ.png" /></figure><h4>3.Scroll view(review)</h4><p>（製作時忘記了還去翻翻以前自己寫的文章🥲，好險有記錄下來）<br>☼簡單敘述：<br>1-拉一個Scroll view和一個大於他的view(圖片放在view上面)<br>2-設定Scroll view的contentSize<br>(x , y 代表你要它移動的方向看是要上下還左右)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*luzTGn3B2TANq2eiEjBBMw.png" /><figcaption>設定x軸 →橫向移動圖</figcaption></figure><pre>import UIKit<br><br>class ViewController: UIViewController {<br>    <br>    @IBOutlet weak var baseSelect: UISegmentedControl!<br>    <br>    @IBOutlet weak var mainCourseSelect: UISegmentedControl!<br>    @IBOutlet weak var sideDishSlider: UISlider!<br>    @IBOutlet weak var sideDishNumber: UILabel!<br>    @IBOutlet weak var sauceSwitch: UISwitch!<br>    @IBOutlet weak var noodelSwitch: UISwitch!<br>    @IBOutlet weak var remarkTextfield: UITextField!<br>    <br>    @IBOutlet weak var contentField: UITextView!<br>    //先設定變數給以下<br>    var baseSet = &quot;嫩萵苣&quot;<br>    var mainSet = &quot;舒肥雞胸&quot;<br>    var sauceSet = &quot;手作醬料&quot;<br>    var noodleSet = &quot;天使冷麵&quot;<br>    <br>    override func viewDidLoad() {<br>        super.viewDidLoad()<br>        // Do any additional setup after loading the view.<br>    }<br>    //根據選擇切換以上變數（生菜）<br>    @IBAction func baseSetSelect(_ sender: Any) {<br>        if baseSelect.selectedSegmentIndex == 0{<br>            baseSet = &quot;嫩萵苣&quot;<br>        }else {<br>            baseSet = &quot;脆生菜&quot;<br>        }<br>    }<br>    //切換主食<br>    @IBAction func mainSetSelect(_ sender: Any) {<br>        if mainCourseSelect.selectedSegmentIndex == 0{<br>            mainSet = &quot;舒肥雞胸&quot;<br>        }else if mainCourseSelect.selectedSegmentIndex == 1{<br>            mainSet = &quot;鹽烤鮭魚&quot;<br>        }else{<br>            mainSet = &quot;嫩煎牛排&quot;<br>        }<br>    }<br><br>        //設定配料數量 //使float轉為int //數字轉換為字串 &quot;\()&quot;_會保留小數點 or Int(sender.value).descripition轉換整數並讀取property<br>        @IBAction func sideSliderChange(_ sender: UISlider) {<br>            sender.value.round()  //先轉換為整數<br>            sideDishNumber.text = sender.value.formatted(.number.precision(.fractionLength(0)))<br>        }//formatted()也可轉換為字串<br>        <br>    @IBAction func sauceSetSelect(_ sender: Any) {<br>        if sauceSwitch.isOn{<br>            sauceSet = &quot;手工醬料&quot;<br>        }else{<br>            sauceSet = &quot;&quot;<br>        }<br>    }<br>    @IBAction func noodleSetSelect(_ sender: Any) {<br>        if noodelSwitch.isOn{<br>            noodleSet = &quot;天使冷麵&quot;<br>        }else{<br>            noodleSet = &quot;&quot;<br>        }<br>    }<br>    <br>    <br>        @IBAction func orderButtom(_ sender: Any) {<br>            contentField.text = &quot;The Best Salad:\n\(baseSet)+\(mainSet)+\(sideDishNumber.text!)種配料\n\(sauceSet)\n\(noodleSet)\n (\(remarkTextfield.text!))&quot;<br>        }<br>        <br>    }</pre><p>最後謝謝各位學長姐及Peter的文章：</p><ul><li><a href="https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E6%95%99%E5%AE%A4/ibaction-iboutlet%E7%B7%B4%E7%BF%92-%E6%93%87%E5%81%B6%E6%A2%9D%E4%BB%B6-68fc3ec1a5ac">IBAction&amp;IBOutlet練習｜擇偶條件</a></li><li><a href="https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E6%95%99%E5%AE%A4/2-%E6%93%87%E5%81%B6%E6%A2%9D%E4%BB%B6app-%E8%A8%82%E9%A3%B2%E6%96%99-27461adcc997">#2 擇偶條件App — 訂飲料</a></li></ul><p>GitHub網址：</p><p><a href="https://github.com/ji3g4vic/orderSalad">https://github.com/ji3g4vic/orderSalad</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bafbf538bc3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/15-if-else-%E7%B7%B4%E7%BF%92-%E9%BB%9E%E9%A4%90-7bafbf538bc3">＃15 if else 練習｜點餐</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[#14 調色大師＿找尋異色寶可夢]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/14-%E8%AA%BF%E8%89%B2%E5%A4%A7%E5%B8%AB-%E6%89%BE%E5%B0%8B%E7%95%B0%E8%89%B2%E5%AF%B6%E5%8F%AF%E5%A4%A2-c3fbc94b7333?source=rss-1344ea432c45------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3fbc94b7333</guid>
            <dc:creator><![CDATA[Winnie]]></dc:creator>
            <pubDate>Sun, 05 Feb 2023 08:24:27 GMT</pubDate>
            <atom:updated>2023-02-05T14:37:17.276Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>☀︎主要練習目標：R</strong>andom、UISilder、UIColor、UIAction</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*WJ-z1SJWhSUwPXEO_NGCTA.gif" /></figure><blockquote>Step1:<br>找尋背景圖片後，等比例按照圖片大小挖一個洞並將想更改顏色的部分去背，然後將圖片放置於洞洞當中～。</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gCyRGZf-lS1qnn-vcIqZ9g.png" /></figure><blockquote>Step2:<br>將需要操作及改變的部分拉上IBOutlet和IBAction，這邊要注意的是silder要使用的功能相同，故拉到同一個IBAction。</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UvcOvDZXr--lpN-QDzQh2g.png" /></figure><blockquote>Step3:<br>最後是設定隨機亂數及更改顏色的功能，更改時顏色要注意型別的轉換，另外加上silder移動的動畫增添一點視覺效果。</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*efXougTG6Nkz8EhlwTzevA.png" /></figure><p>☀︎完整程式碼及GitHub網址：</p><pre>import UIKit<br><br>class ViewController: UIViewController {<br><br>@IBOutlet weak var redSilder: UISlider!<br>@IBOutlet weak var greenSilder: UISlider!<br>@IBOutlet weak var alphaSilder: UISlider!<br>@IBOutlet weak var blueSilder: UISlider!<br>    <br>@IBOutlet weak var backgroundImageView: UIImageView!<br>    override func viewDidLoad() {<br>        super.viewDidLoad()<br>        backgroundImageView.backgroundColor = UIColor.systemMint<br>        // Do any additional setup after loading the view.<br>    }<br><br>    @IBAction func changeColor(_ sender: Any) {<br>        backgroundImageView.backgroundColor = UIColor(red: CGFloat(redSilder.value), green: CGFloat(greenSilder.value), blue: CGFloat(blueSilder.value), alpha: CGFloat(alphaSilder.value))<br>    }<br>    <br>    @IBAction func random(_ sender: Any) {<br>        redSilder.setValue(Float.random(in: 0...1), animated: true)<br>        greenSilder.setValue(Float.random(in: 0...1), animated: true)<br>        blueSilder.setValue(Float.random(in: 0...1), animated: true)<br>        alphaSilder.setValue(Float.random(in: 0...1), animated: true)<br>        backgroundImageView.backgroundColor = UIColor(red: CGFloat(redSilder.value), green: CGFloat(greenSilder.value), blue: CGFloat(blueSilder.value), alpha: CGFloat(alphaSilder.value))<br><br>    }<br>}</pre><p><a href="https://github.com/ji3g4vic/clothesChangeColor">https://github.com/ji3g4vic/clothesChangeColor</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3fbc94b7333" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/14-%E8%AA%BF%E8%89%B2%E5%A4%A7%E5%B8%AB-%E6%89%BE%E5%B0%8B%E7%95%B0%E8%89%B2%E5%AF%B6%E5%8F%AF%E5%A4%A2-c3fbc94b7333">#14 調色大師＿找尋異色寶可夢</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[#13 Silder 移動元件_Pokemon Evaloution]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/13-silder-%E7%A7%BB%E5%8B%95%E5%85%83%E4%BB%B6-pokemon-evaloution-d67bb42d8af?source=rss-1344ea432c45------2</link>
            <guid isPermaLink="false">https://medium.com/p/d67bb42d8af</guid>
            <dc:creator><![CDATA[Winnie]]></dc:creator>
            <pubDate>Tue, 17 Jan 2023 04:48:36 GMT</pubDate>
            <atom:updated>2023-01-17T06:28:27.155Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*39yUHSTjJG3XigWQL06coQ.gif" /></figure><h4>Step1:</h4><p>將所選圖片加入Assets(Preview去背)，並拉出Outlet和Action</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vwm59Q70r813ywixvEbuVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*THi-6WDxkWEY7uORACTsNA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*pvPxV6Hgi_0LTFh7wfqIVg.png" /></figure><h4>Step2:</h4><p>設定slider的值（代表slider移動的總範圍，由於後續想讓旁邊兩顆球轉動，所以直接設定值為180&lt;轉動一圈360度&gt;），並加上轉動的func，因為我沒有要移動球的位置，就沒有打上translatedBy，讓它自轉起來。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*SteTiZ8NAjXkWscg8nNljw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BfPJcyPYYb2AH5HQP_mWGw.png" /></figure><p>轉動主要參考以下文章：<br><a href="https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E5%95%8F%E9%A1%8C%E8%A7%A3%E7%AD%94%E9%9B%86/%E6%97%8B%E8%BD%89-view-%E7%9A%84%E6%96%B9%E6%B3%95-5deea94fd3a2">https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E5%95%8F%E9%A1%8C%E8%A7%A3%E7%AD%94%E9%9B%86/%E6%97%8B%E8%BD%89-view-%E7%9A%84%E6%96%B9%E6%B3%95-5deea94fd3a2</a></p><p><a href="https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E5%95%8F%E9%A1%8C%E8%A7%A3%E7%AD%94%E9%9B%86/ios-app-%E8%AE%93%E5%85%83%E4%BB%B6%E7%B9%9E%E5%9C%93%E7%A7%BB%E5%8B%95%E7%9A%84%E6%96%B9%E6%B3%95-fe91fb66062f">iOS App 讓元件繞圓移動的方法</a></p><h4>Step3:</h4><ol><li>拉出Silder的Action，而view主要以橫移的方式移動，所以先找出兩個view的x讓他加減silder的value</li><li>設計圖片的透明度，圖片的alpha值為0~1</li><li>最後兩張圖片碰再一起時，也就是silder值最大的時候，兩張圖片能夠透明，並顯示出隱藏的圖片。<br>（因為隱藏的程式寫在Silder上，所以剛執行未拉動Silder時會顯示出來，解決方式：1.storyboard上先把view的alpha設置為0 2.viewDidLoad加一行）</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BrSgHSXRaCvfToFx6pFmvA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*5-rH7_7LOxQQugPy4bu9wQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*Lx2YvbpQleJlMYc37hWiDg.png" /></figure><p>移動及圖片透明度參考以下文章：<br><a href="https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E5%95%8F%E9%A1%8C%E8%A7%A3%E7%AD%94%E9%9B%86/%E8%AA%BF%E6%95%B4%E5%85%83%E4%BB%B6%E4%BD%8D%E7%BD%AE%E7%9A%84%E5%9B%9B%E7%A8%AE%E6%96%B9%E6%B3%95-238565e19100">https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E5%95%8F%E9%A1%8C%E8%A7%A3%E7%AD%94%E9%9B%86/%E8%AA%BF%E6%95%B4%E5%85%83%E4%BB%B6%E4%BD%8D%E7%BD%AE%E7%9A%84%E5%9B%9B%E7%A8%AE%E6%96%B9%E6%B3%95-238565e19100</a><br><a href="https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E6%95%99%E5%AE%A4/%E8%B8%8F%E4%B8%8A%E6%85%A2%E9%95%B7%E7%9A%84ios%E9%96%8B%E7%99%BC%E5%AD%B8%E7%BF%92%E4%B9%8B%E6%97%85-013-2000bc12f0f5">https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E6%95%99%E5%AE%A4/%E8%B8%8F%E4%B8%8A%E6%85%A2%E9%95%B7%E7%9A%84ios%E9%96%8B%E7%99%BC%E5%AD%B8%E7%BF%92%E4%B9%8B%E6%97%85-013-2000bc12f0f5</a></p><p>以下為完整程式碼及GitHub網址:<br><a href="https://github.com/ji3g4vic/silderPractive">https://github.com/ji3g4vic/silderPractive</a></p><pre>import UIKit<br><br>class ViewController: UIViewController {<br><br>    @IBOutlet weak var seadraView: UIImageView!<br>    @IBOutlet weak var growlitheView: UIImageView!<br>    @IBOutlet weak var sealitheView: UIImageView!<br>    @IBOutlet weak var ballView1: UIImageView!<br>    @IBOutlet weak var ballView2: UIImageView!<br>    func updateLocation(degress: CGFloat){<br>        ballView1.transform = CGAffineTransform.identity.rotated(by: CGFloat.pi / 90 * degress)<br>        ballView2.transform = CGAffineTransform.identity.rotated(by: CGFloat.pi / 90 * degress)<br>        <br>    }<br>    override func viewDidLoad() {<br>        super.viewDidLoad()<br>        sealitheView.alpha = 0<br>        // Do any additional setup after loading the view.<br>    }<br><br>    @IBAction func ballSilder(_ sender: UISlider) {<br>        seadraView.frame.origin.x = CGFloat(125+sender.value)<br>        growlitheView.frame.origin.x = CGFloat(575-sender.value)<br>        seadraView.alpha = CGFloat(sender.value / 80)<br>        growlitheView.alpha = CGFloat(sender.value / 80)<br>        updateLocation(degress: CGFloat(sender.value))<br>        if sender.value == 180{<br>            seadraView.alpha = 0<br>            growlitheView.alpha = 0<br>            sealitheView.alpha = 1<br>        }else{<br>            sealitheView.alpha = 0<br>        }<br>    }<br>    <br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d67bb42d8af" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/13-silder-%E7%A7%BB%E5%8B%95%E5%85%83%E4%BB%B6-pokemon-evaloution-d67bb42d8af">#13 Silder 移動元件_Pokemon Evaloution</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[#12一起說個小故事吧～]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/12%E4%B8%80%E8%B5%B7%E8%AA%AA%E5%80%8B%E5%B0%8F%E6%95%85%E4%BA%8B%E5%90%A7-c2787862051?source=rss-1344ea432c45------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2787862051</guid>
            <dc:creator><![CDATA[Winnie]]></dc:creator>
            <pubDate>Mon, 09 Jan 2023 02:38:36 GMT</pubDate>
            <atom:updated>2023-01-09T06:03:23.299Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>目標：</strong><br>1.字串替換<br>2.利用textField＆textView&amp;Button做IBOutlet&amp;IBAction的練習<br>3.AVSpeechSynthesizer將故事說出</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*--_l7KwMeIhKwMdY1JoFFQ.gif" /></figure><p><a href="https://streamable.com/xq1tpc">https://streamable.com/xq1tpc</a> (有聲音版本)</p><p>1.字串替換( <strong>\( )</strong> ）<br>⚠️ text是String?的型別，所以要加！讀取，可以參考以下介紹<a href="https://www.appcoda.com.tw/swift-optional-intro/">https://www.appcoda.com.tw/swift-optional-intro/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZaomTrijhyYO4li3eYmvvg.png" /></figure><p>2.利用textField＆textView&amp;Button做IBOutlet&amp;IBAction的練習</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*Y-pgwvM2LMsNEu3wQZzxDw.png" /></figure><p>3.AVSpeechSynthesizer將故事說出</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8iqA9PpeyrmpF2XlC0QZxQ.png" /></figure><p>4.最後是storyboard內的一些設定：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*5ZAonwHecrFSAlx-4Wi3gA.png" /><figcaption><strong>（輸入文字時，原本的字即消失）</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*DzZXnGg0ltMQcM1bIQCpvw.png" /><figcaption><strong>（顯示出來的文字不被編輯或選擇）</strong></figcaption></figure><p>最後附上GitHu網址:<a href="https://github.com/ji3g4vic/storyApp">https://github.com/ji3g4vic/storyApp</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2787862051" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/12%E4%B8%80%E8%B5%B7%E8%AA%AA%E5%80%8B%E5%B0%8F%E6%95%85%E4%BA%8B%E5%90%A7-c2787862051">#12一起說個小故事吧～</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[＃11定義class及使用inheritance]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/11%E5%AE%9A%E7%BE%A9class%E5%8F%8A%E4%BD%BF%E7%94%A8inheritance-b29d3fea0da3?source=rss-1344ea432c45------2</link>
            <guid isPermaLink="false">https://medium.com/p/b29d3fea0da3</guid>
            <dc:creator><![CDATA[Winnie]]></dc:creator>
            <pubDate>Tue, 03 Jan 2023 05:37:20 GMT</pubDate>
            <atom:updated>2023-01-03T10:17:27.248Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>主要應用：<br></strong>1.設定class(property&amp;method)<br>2.class內修改property<br>3.應用inheritance(繼承)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*BnA_o0UTUk48iKEN.jpg" /></figure><p>(深蹲蹲下去，跛腳走出gym)</p><h4>1.設定class(property&amp;method)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mQI-Ax5NMLy6TwDasFNM5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SrmPO68vg4eHPTp4gSnWPA.png" /></figure><h4>2.class內修改property</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1gfSFagjDHN9PzszGMMoRQ.png" /></figure><h4>3.應用inheritance(繼承)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e5vYbexopHUU_d7U3Hv33A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b29d3fea0da3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/11%E5%AE%9A%E7%BE%A9class%E5%8F%8A%E4%BD%BF%E7%94%A8inheritance-b29d3fea0da3">＃11定義class及使用inheritance</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[＃10自訂 controller 類別和利用 viewDidLoad 客製 App 畫面]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/10%E8%87%AA%E8%A8%82-controller-%E9%A1%9E%E5%88%A5%E5%92%8C%E5%88%A9%E7%94%A8-viewdidload-%E5%AE%A2%E8%A3%BD-app-%E7%95%AB%E9%9D%A2-a3bb5c92da12?source=rss-1344ea432c45------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3bb5c92da12</guid>
            <dc:creator><![CDATA[Winnie]]></dc:creator>
            <pubDate>Mon, 02 Jan 2023 03:57:54 GMT</pubDate>
            <atom:updated>2023-01-02T11:31:07.748Z</atom:updated>
            <content:encoded><![CDATA[<p>這一次的作業參考了學長姐及Peter的文章，深深感謝詳細記錄文章的各位。</p><p>先放上這一次的成品，以示誠意：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*mPz5avfTqWW8XLfpg_sA_Q.gif" /></figure><p>完整影片：<a href="https://streamable.com/l33z8z">https://streamable.com/zloj6h</a></p><p>以下正文開始：</p><ol><li>尋找方向：</li></ol><p>看完了下面這篇文章後，開始尋找照片作為靈感，最後找到了這張年少青澀時留下的照片。<a href="https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E6%95%99%E5%AE%A4/%E4%BD%9C%E6%A5%AD-%E5%88%A9%E7%94%A8-viewdidload-%E5%AE%A2%E8%A3%BD-app-%E7%95%AB%E9%9D%A2-fa03cb0bd3e6">https://medium.com/%E5%BD%BC%E5%BE%97%E6%BD%98%E7%9A%84-swift-ios-app-%E9%96%8B%E7%99%BC%E6%95%99%E5%AE%A4/%E4%BD%9C%E6%A5%AD-%E5%88%A9%E7%94%A8-viewdidload-%E5%AE%A2%E8%A3%BD-app-%E7%95%AB%E9%9D%A2-fa03cb0bd3e6</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IX22MXwApQ59d22tY_i3kg.jpeg" /></figure><p>2.製作：</p><p>這次製作主要使用了以下的功能：<br>（前面有使用CAGradientLayer 製作漸層，不過覺得動圖和背景漸層色彩始終有些微差異，因此砍掉漸層直接以動圖作為背景）<br>(1)UIImageView放入動畫和不同的圖片</p><pre>        //加入雲動畫<br>        let cloudView = UIImageView(frame: CGRect(x: 0, y: 0, width: 400, height: 240))<br>            cloudView.frame = view.bounds<br>            view.addSubview(cloudView)<br>        let animatedImage = UIImage.animatedImageNamed(&quot;aa4cba8bdcbd4fb7aa6182122b64b8e7KShMDPadio3bCXLQ-&quot;, duration: 10)<br>            cloudView.image = animatedImage<br>        //加入背景照片<br>        let shadowView = UIImageView(image: UIImage(named: &quot;shadow&quot;))<br>            shadowView.frame = CGRect(x: 2, y: 458, width: 380 , height: 500)<br>            view.addSubview(shadowView)</pre><p>(2)AVPlayer播放音樂<br>⚠️ 播放器要在viewDidLoad前，函式庫記得加進去 import AVFoundation</p><pre>    let player = AVPlayer() //生成播放器<br><br>        override func viewDidLoad() {<br>        super.viewDidLoad()<br>        //加入音樂<br>            let url = Bundle.main.url(/service/forresource: &quot;%E6%B8%B8%E5%96%A7 %E5%8B%BE%E5%8B%BE%E6%89%8B mv %E5%AE%8C%E6%95%B4%E7%89%88&quot;, withExtension: &quot;mp3&quot;)!<br>            let playerItem = AVPlayerItem(url: url)<br>            player.replaceCurrentItem(with: playerItem)<br>            player.play()</pre><p>(3) CABasicAnimation &amp; CAShapeLayer 繪製愛心線條動畫</p><pre> //加入愛心線條動畫<br>        let path = UIBezierPath()<br>            path.move(to: CGPoint(x: 0, y: 435))<br>            path.addLine(to: CGPoint(x: 7, y: 438))<br>            path.addLine(to: CGPoint(x: 18, y: 442))<br>            path.addLine(to: CGPoint(x: 30, y: 444))<br>            path.addLine(to: CGPoint(x: 42, y: 445))<br>            path.addLine(to: CGPoint(x: 53, y: 445))<br>            path.addLine(to: CGPoint(x: 65, y: 445))<br>            path.addLine(to: CGPoint(x: 70, y: 446))<br>            path.addLine(to: CGPoint(x: 76, y: 447))<br>            path.addLine(to: CGPoint(x: 80, y: 443))<br>            path.addLine(to: CGPoint(x: 88, y: 439))<br>            path.addLine(to: CGPoint(x: 100, y: 436))<br>            path.addLine(to: CGPoint(x: 106, y: 433))<br>            path.addLine(to: CGPoint(x: 112, y: 430))<br>            path.addLine(to: CGPoint(x: 115, y: 425))<br>            path.addLine(to: CGPoint(x: 123, y: 423))<br>            path.addLine(to: CGPoint(x: 131, y: 416))<br>            path.addLine(to: CGPoint(x: 146, y: 407))<br>            path.addLine(to: CGPoint(x: 145, y: 397))<br>            path.addLine(to: CGPoint(x: 147, y: 386))<br>            path.addLine(to: CGPoint(x: 135, y: 378))<br>            path.addLine(to: CGPoint(x: 125, y: 375))<br>            path.addLine(to: CGPoint(x: 113, y: 378))<br>            path.addLine(to: CGPoint(x: 107, y: 384))<br>            path.addLine(to: CGPoint(x: 101, y: 379))<br>            path.addLine(to: CGPoint(x: 95, y: 375))<br>            path.addLine(to: CGPoint(x: 89, y: 371))<br>            path.addLine(to: CGPoint(x: 79, y: 373))<br>            path.addLine(to: CGPoint(x: 69, y: 380))<br>            path.addLine(to: CGPoint(x: 65, y: 390))<br>            path.addLine(to: CGPoint(x: 68, y: 400))<br>            path.addLine(to: CGPoint(x: 73, y: 408))<br>            path.addLine(to: CGPoint(x: 77, y: 417))<br>            path.addLine(to: CGPoint(x: 85, y: 423))<br>            path.addLine(to: CGPoint(x: 93, y: 430))<br>            path.addLine(to: CGPoint(x: 100, y: 435))<br>            path.addLine(to: CGPoint(x: 109, y: 440))<br>            path.addLine(to: CGPoint(x: 117, y: 443))<br>            path.addLine(to: CGPoint(x: 127, y: 446))<br>            path.addLine(to: CGPoint(x: 139, y: 447))<br>            path.addLine(to: CGPoint(x: 150, y: 450))<br>            path.addLine(to: CGPoint(x: 159, y: 447))<br>            path.addLine(to: CGPoint(x: 168, y: 447))<br>            path.addLine(to: CGPoint(x: 178, y: 446))<br>            path.addLine(to: CGPoint(x: 196, y: 442))<br>            path.addLine(to: CGPoint(x: 206, y: 440))<br>            path.addLine(to: CGPoint(x: 213, y: 437))<br>            path.addLine(to: CGPoint(x: 222, y: 436))<br>            path.addLine(to: CGPoint(x: 230, y: 435))<br>            path.addLine(to: CGPoint(x: 242, y: 434))<br>            path.addLine(to: CGPoint(x: 253, y: 434))<br>            path.addLine(to: CGPoint(x: 264, y: 435))<br>            path.addLine(to: CGPoint(x: 274, y: 437))<br>            path.addLine(to: CGPoint(x: 284, y: 439))<br>            path.addLine(to: CGPoint(x: 294, y: 445))<br>            path.addLine(to: CGPoint(x: 300, y: 443))<br>            path.addLine(to: CGPoint(x: 320, y: 440))<br>            path.addLine(to: CGPoint(x: 400, y: 444))<br>        let loveLayer = CAShapeLayer()<br>            loveLayer.path = path.cgPath<br>            loveLayer.lineWidth = 3<br>            loveLayer.strokeColor = CGColor(red: 38/255, green: 128/255, blue: 157/255, alpha: 1)<br>            loveLayer.fillColor = nil<br>            view.layer.addSublayer(loveLayer)<br>        let animation = CABasicAnimation(keyPath: &quot;strokeEnd&quot;)<br>            animation.fromValue = 0<br>            animation.toValue = 1<br>            animation.duration = 13<br>            loveLayer.add(animation, forKey: nil)</pre><p>(4)CATransition &amp; Timer製作文字跑馬燈＋UILabel放入歌名<br>⚠️注意：<br>(1)跑馬燈要將label做outlet的動作<br>(2)label1️CATransition&amp;Timer這部分要在viewDidLoad前<br>(3)空格處主要是為了配合音樂的節奏顯示字幕<br>（聽到耳朵要長繭的方法，peter表示要用到進階的方法以後教我）</p><pre> //加入文字跑馬燈（CATransition&amp;Timer）<br>        @IBOutlet weak var label: UILabel!<br>       var index = 0<br>       let songs = [<br>        &quot;                       &quot;,<br>        &quot;                       &quot;,<br>        &quot;                       &quot;,<br>        &quot;偶爾撒嬌 加點耍賴 要你關心她&quot;,<br>        &quot;熬夜不睡 即使疲倦 電話不肯掛&quot;,<br>        &quot;喜歡你陪伴塗鴉 再聽她說說傻話&quot;,<br>        &quot;              &quot;,<br>        &quot;輕輕的親吻臉頰 不厭其煩說愛她&quot;,<br>        &quot;偶爾霸道 因為不安 怕你不要她&quot;,<br>        &quot;假裝好強 其實委屈 眼淚等你擦&quot;,<br>        &quot;不快樂她自己藏 就算被笑是傻瓜&quot;,<br>        &quot;           &quot;,<br>        &quot;只想甜的像顆糖 在你胸口慢慢的&quot;,<br>        &quot;融化&quot;,<br>        &quot;她或許不完美 任性的小缺點&quot;,<br>        &quot;安靜的嘟著嘴 就是想你多陪一會&quot;,<br>        &quot; &quot;,<br>        &quot;她不要求完美 一杯開水也能醉&quot;,<br>        &quot;給的愛不准浪費 勾勾手不後悔&quot;,<br>        &quot; &quot;,<br>        &quot; &quot;,<br>        &quot; &quot;,<br>        &quot; &quot;,<br>        &quot;偶爾霸道 因為不安 怕你不要她&quot;,<br>        &quot;假裝好強 其實委屈 眼淚等你擦&quot;,<br>        &quot;不快樂她自己藏 就算被笑是傻瓜&quot;,<br>        &quot; &quot;,<br>        &quot;只想甜的像顆糖 在你胸口慢慢的&quot;,<br>        &quot;融化&quot;,<br>        &quot;她或許不完美 任性的小缺點&quot;,<br>        &quot;安靜的嘟著嘴 就是想你多陪一會&quot;,<br>        &quot;她不要求完美 一杯開水也能醉&quot;,<br>        &quot; &quot;,<br>        &quot;給的愛不准浪費 勾勾手不後悔&quot;,<br>        &quot;她或許不完美 任性的小缺點&quot;,<br>        &quot;安靜的嘟著嘴 就是想你多陪一會&quot;,<br>        &quot; &quot;,<br>        &quot;她不要求完美 一杯開水也能醉&quot;,<br>        &quot;給的愛不准浪費 勾勾手不後悔&quot;,<br>        &quot; &quot;,<br>        &quot;給的愛不准浪費 勾勾手不後悔&quot;<br>       ]<br>    var timer : Timer?<br>    //定義nextSong跟移動效果<br>    func nextSong(){<br>        index = (index + 1) % songs.count<br>        let transition = CATransition()<br>        transition.duration = 3<br>        transition.type = .push<br>        transition.subtype = .fromTop<br>        label.text = songs[index]<br>        label.layer.add(transition, forKey: &quot;nextSong&quot;)<br>    }</pre><pre>           //加入跑馬燈文字（viewDidLoad裡面）<br><br>                label.text = songs[index]<br>                timer = Timer.scheduledTimer(withTimeInterval: 5,  repeats: true) { _ in self.nextSong()}<br>                view.addSubview(label)<br>            //加入歌名text<br>            let lable1 = UILabel(frame: CGRect(x: 245, y: 385, width: 132, height: 40))<br>            lable1.text = &quot;勾勾手&quot;<br>            lable1.textColor = UIColor(cgColor: CGColor(red: 0, green: 113/255, blue: 169/225, alpha: 1))<br>            lable1.font = UIFont.systemFont(ofSize: 30)<br>            view.addSubview(lable1)</pre><p>最後附上GitHub網址：</p><p><a href="https://github.com/ji3g4vic/viewDidLoad-practice">https://github.com/ji3g4vic/viewDidLoad-practice</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3bb5c92da12" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/10%E8%87%AA%E8%A8%82-controller-%E9%A1%9E%E5%88%A5%E5%92%8C%E5%88%A9%E7%94%A8-viewdidload-%E5%AE%A2%E8%A3%BD-app-%E7%95%AB%E9%9D%A2-a3bb5c92da12">＃10自訂 controller 類別和利用 viewDidLoad 客製 App 畫面</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>