<?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 Jasmine Chen on Medium]]></title>
        <description><![CDATA[Stories by Jasmine Chen on Medium]]></description>
        <link>https://medium.com/@jasmine888tw?source=rss-2ce273110de9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oYlExU02q4DjDWj2--IJCg.jpeg</url>
            <title>Stories by Jasmine Chen on Medium</title>
            <link>https://medium.com/@jasmine888tw?source=rss-2ce273110de9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 11:20:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jasmine888tw/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[《少，但是更好》逆風讀後感想]]></title>
            <link>https://jasmine888tw.medium.com/%E5%B0%91-%E4%BD%86%E6%98%AF%E6%9B%B4%E5%A5%BD-%E9%80%86%E9%A2%A8%E8%AE%80%E5%BE%8C%E6%84%9F%E6%83%B3-d1157b152eef?source=rss-2ce273110de9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1157b152eef</guid>
            <category><![CDATA[讀書心得]]></category>
            <category><![CDATA[隨便聊聊]]></category>
            <dc:creator><![CDATA[Jasmine Chen]]></dc:creator>
            <pubDate>Tue, 10 Aug 2021 14:55:35 GMT</pubDate>
            <atom:updated>2021-08-10T14:55:35.645Z</atom:updated>
            <content:encoded><![CDATA[<h4>不精準的精準主義</h4><p>「聚焦力」是公司推薦書單六月的主題，抱著能夠學到「精」「簡」「準」的生活方式。沒想到本書就是最不精簡準的組成。</p><h3>「專準主義」？</h3><p>本書中作者不斷提到「專準主義」一詞。初見時就字義上來看應該是對事情態度專一，心無旁騖專注在自己的道路上。但本書中卻將所有作者自己理想的理念、態度、方式、榜樣、生活型態通通囊括到「專準主義」中。</p><p>第一章節「如何成為精簡準的人」中，明確提出現在人們因為資訊量多選擇也多，看不清楚什麼才是「最優先」事項而讓自己處於瞎忙的狀態。因此才要調整成精簡準主義的生活型態。</p><p>書中在精簡準三個大章節與個別的小章節分別是，</p><ul><li>精挑：逃離、留意、玩樂、睡眠、嚴選</li><li>簡化：釐清、膽量、取消承諾、剪輯、界線</li><li>準確執行：緩衝、減法、進展、心流、專注、存在</li></ul><p>小章節內容絕大多數跟主題對不上啊……。連好好睡覺、調整生活作息、好好享樂之類的身心靈健康內容都收錄進去了，這個精準主義包含的範圍也太廣太不精準了。</p><h3>選擇，做自己人生的主人</h3><p>雖然我覺得內容很不精準，但並不覺得本書很雷，它依然提供了很棒的生活態度。實際上本書內容一大半著重於「選擇」上。懂得辨別、取捨，才懂得依自我意志做出選擇。</p><p>在資訊逐年攀升，選擇相比以前更繁雜，做決定也更難。相比過去，的確單純就是美好。不過現代人也因為選擇更多，機會也更多。除了掌握自己的「選擇權」外，也要審視這「選擇」是否真的是出自本心？還是只是別人逼你選出來的？</p><p>「選擇」也並不單單指事業、學業上的規劃而已。小至工作、會議，大到職涯、學業、事業與家庭的抉擇。是要一直向前衝呢？還是緩下腳步留些時間給自己與家人呢？</p><p>文章中可以感覺到作者很在意自己過去沒有好好留時間給自己和家人，而選擇了將精力花在事業上。成為高階主管後開始有時間慢下腳步，回顧自己人生時發現自己錯過了很多。作者希望其他人也能注意到人生最重要的並不是事業，停下腳步看看吧，你的人生還有更重要的事情。</p><h3>人生怎麼「少，但是更好」？</h3><p>我推薦去看近藤麻理惠的《怦然心動的人生整理魔法》。雖然感覺好像是家事整理工具書，但是作者教導客戶從「整理房子」的生活開始，整理自己的人生。</p><p>整理分成三大類：衣物、文件、紀念品，依照這個順序去整理。衣服是最容易做取捨的，因此在整理完衣物後，後面的整理程序也會越來越上手。人生也是一樣，從小事開始做取捨，未來遇到更重要的抉擇時，停下來聽聽自己內心，什麼才是最重要、最能觸動你心的選擇？</p><p>題外話，《少，但是更好》書中「緩衝」那章，作者為了向孩子解釋執行時留些緩衝區的概念時所玩的「小遊戲」，作者啊這樣很好懂啦但是這樣很危險拜託別這樣搞。</p><blockquote>想像我們到三英里外的目的地，中途不能停車，我們無法預測前方會發生什麼事。我們不知道綠燈會多久，或是前方車子會不會忽然轉向或踩剎車。唯一避免碰撞就是在車與車之間預留緩衝空間。</blockquote><blockquote>在和孩子們玩車內「遊戲」時，當我因為說話或談笑而分心時，我會忘記保留緩衝，變得太靠近前車，不得不做一些「不自然」的事 ——像是突然轉向，或在最後一秒猛踩煞車——加以調整。（簡單節錄部分內容）</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1157b152eef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[【菜逼八html/css筆記】a標籤做按鈕]]></title>
            <link>https://jasmine888tw.medium.com/%E8%8F%9C%E9%80%BC%E5%85%ABhtml-css%E7%AD%86%E8%A8%98-a%E6%A8%99%E7%B1%A4%E5%81%9A%E6%8C%89%E9%88%95-3ac6d7b59d4c?source=rss-2ce273110de9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ac6d7b59d4c</guid>
            <category><![CDATA[html-css]]></category>
            <dc:creator><![CDATA[Jasmine Chen]]></dc:creator>
            <pubDate>Thu, 26 Nov 2020 12:41:39 GMT</pubDate>
            <atom:updated>2020-11-26T12:41:39.599Z</atom:updated>
            <content:encoded><![CDATA[<pre>&lt;div&gt;<br>  &lt;a href=&quot;#&quot;&gt;連結&lt;/a&gt;<br>&lt;div&gt;</pre><p>由於 a 標籤是行內元素，所以能夠點擊的就只有本體而已，div 被 padding 撐出來的空間就算點擊了也沒用。（如果沒有設 display: block的話，能點擊的部分就只有文字本體）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/198/1*hIMp0LJ1ZPi8igLCMWBKQQ.png" /><figcaption>紅色為可點擊的部分，上下白色區域為在 div 中用 padding 撐出來的空間</figcaption></figure><pre>div{<br>  border: 1px solid black;<br>  padding: 15px 0;<br>  width: 200px;<br>  margin: 0 auto;<br>}<br>a{<br>  display: block;<br>  text-align: center; <br>  background-color: red;<br>  color: white;<br>}</pre><p>若是要讓整個區塊都可以當作是 a 標籤點擊的話，要先把 a 標籤轉換為區塊元素（上一步為了美觀已經先做好了），再來把 padding 的設定移到 a 標籤去。這樣整個按鈕空間就都能點擊啦～</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/214/1*KGUbQ7uBNY2loiaHFdxBPQ.png" /><figcaption>紅色為可點擊的部分</figcaption></figure><pre>div{<br>  border: 1px solid black;<br>  width: 200px;<br>  margin: 0 auto;<br>}<br>a{<br>  display: block;<br>  text-align: center; <br>  background-color: red;<br>  color: white; <br>  padding: 15px 0;<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ac6d7b59d4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[【菜逼八html/css筆記】margin/padding與盒模型尺寸的關係]]></title>
            <link>https://jasmine888tw.medium.com/%E8%8F%9C%E9%80%BC%E5%85%ABhtml-css%E7%AD%86%E8%A8%98-margin-padding%E8%88%87%E7%9B%92%E6%A8%A1%E5%9E%8B%E5%B0%BA%E5%AF%B8%E7%9A%84%E9%97%9C%E4%BF%82-d653c41f6dfb?source=rss-2ce273110de9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d653c41f6dfb</guid>
            <category><![CDATA[html-css]]></category>
            <dc:creator><![CDATA[Jasmine Chen]]></dc:creator>
            <pubDate>Wed, 25 Nov 2020 11:15:01 GMT</pubDate>
            <atom:updated>2020-11-25T11:15:01.744Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*wbBNvJKgWFCnNFvwEJAH5A.png" /></figure><p>左邊圖片是 Google 檢查功能會顯示的樣式。實線內為盒模型的實際大小，包含本體、Padding、Border。最外面虛線的 Margin 則是不算在實際尺寸內。</p><p>若是要讓 Border 不要擴張 Box大小的話，要加上box-sizing:border-box，加入的邊框或內距就會向內扣除，在排版時十分方便。</p><p>border-box 是自動計算扣除 padding 與 border 後的剩餘空間，不會因為本體的尺寸而受影響。當本體尺寸被扣除完後，就只會留下 padding 與 border 的空間啦～</p><p>實際測試如下，box-sizing:border-box的測試可以改css內的.box來玩玩看border-box 跟本體、border、padding 的關係</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fjasmine-chen%2Fembed%2Fpreview%2FPozvMQg%3Fheight%3D600%26slug-hash%3DPozvMQg%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;display_name=CodePen&amp;url=https%3A%2F%2Fcodepen.io%2Fjasmine-chen%2Fpen%2FPozvMQg%3Feditors%3D1100&amp;image=https%3A%2F%2Fassets.codepen.io%2F1915454%2Finternal%2Fscreenshots%2Fpens%2FPozvMQg.default.png%3Ffit%3Dcover%26amp%3Bformat%3Dauto%26amp%3Bha%3Dfalse%26amp%3Bheight%3D360%26amp%3Bquality%3D75%26amp%3Bv%3D2%26amp%3Bversion%3D1606130207%26amp%3Bwidth%3D640&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/affc316b887c38ef19154826ba1830db/href">https://medium.com/media/affc316b887c38ef19154826ba1830db/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d653c41f6dfb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[【菜逼八html/css筆記】後代選擇器＆子元素選擇器]]></title>
            <link>https://jasmine888tw.medium.com/%E8%8F%9C%E9%80%BC%E5%85%ABhtml-css%E7%AD%86%E8%A8%98-%E5%BE%8C%E4%BB%A3%E9%81%B8%E6%93%87%E5%99%A8-%E5%AD%90%E5%85%83%E7%B4%A0%E9%81%B8%E6%93%87%E5%99%A8-ea3a1b347b5a?source=rss-2ce273110de9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea3a1b347b5a</guid>
            <category><![CDATA[html-css]]></category>
            <dc:creator><![CDATA[Jasmine Chen]]></dc:creator>
            <pubDate>Fri, 20 Nov 2020 11:58:41 GMT</pubDate>
            <atom:updated>2020-11-20T11:58:41.817Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>後代選擇器</strong>：選擇指定標籤/id/class後的所有後代（包含子輩、孫輩、曾孫輩…等所有後代）<br>寫法：標籤名稱1＋空格＋標籤名稱2</p><pre>標籤名稱1 標籤名稱2{屬性：值}</pre><p><strong>子元素選擇器</strong>：選擇指定標籤下的直接子元素，再往下的孫輩曾孫輩都不會被選擇到<br>寫法：標籤名稱1＋&gt;＋標籤名稱2</p><pre>標籤名稱1&gt;標籤名稱2{屬性：值}</pre><p>兩者區別：</p><ol><li>連結符號：後代選擇器『空格』、子元素選擇器『&gt;』</li><li>選擇範圍：後代選擇器『下面全部後代』、子元素選擇器『直接子元素』</li></ol><p>實際差別請參考以下網址<br><a href="https://codepen.io/jasmine-chen/pen/jOroyZJ?editors=1100">https://codepen.io/jasmine-chen/pen/jOroyZJ?editors=1100</a></p><p>（為了實用性就懶得上其他樣式了）</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea3a1b347b5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[過了段時間才寫的-彼得潘 iOS App程式設計課程心得]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/%E9%81%8E%E4%BA%86%E6%AE%B5%E6%99%82%E9%96%93%E6%89%8D%E5%AF%AB%E7%9A%84-%E5%BD%BC%E5%BE%97%E6%BD%98-ios-app%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88%E8%AA%B2%E7%A8%8B%E5%BF%83%E5%BE%97-4c1d7bd580a8?source=rss-2ce273110de9------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c1d7bd580a8</guid>
            <dc:creator><![CDATA[Jasmine Chen]]></dc:creator>
            <pubDate>Tue, 11 Jul 2017 10:05:53 GMT</pubDate>
            <atom:updated>2017-07-11T10:05:53.691Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>『相信各位都是十年經驗工程師』</strong></h3><p>這句話彼得潘超常說的<br>每次的我：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/185/1*gCmqHViaai4myNXyVaPyLA.png" /></figure><p>哈哈哈我半點語言都不會啦<br>只會改改無名小站跟噗浪背景而已</p><p>一開始是為了想轉換跑道，找個寫app的課程來上<br>google跳出來第一個是文組生的ios課程<br>原本是要上文組班的課<br>結果我爹他說：<br>『我們家小孩怎麼可能需要上那麼簡單的課，那些自己看看就好了』<br>於是展開了越級打怪的生活</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/173/1*tMbIIEXC-SVeCuXZMVcduA.png" /></figure><p>不過好險彼得潘教的很仔細<br>從不需要寫code的排版教起<br>這些拉來拉去把圖片和其他元件排上去是我老本行啊ＸＤ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/185/1*iE4lnpnw-NT7bUa5CwnODQ.png" /></figure><p>即使到了後面要開始搭配swift語法的部分我整個聽的霧煞煞的時候<br>彼得潘也會幫我解答很多對十年經驗工程師來說是廢話的問題<br>每次上課3小時，再加上自己做作業＆問彼得潘問題<br>讓我生出不少有趣的APP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/172/1*BNwEYdg45ZQIla9NSKZeoQ.png" /></figure><p>即使課程結束了<br>閒暇時間我還是會複習＆學些新的東西<br>外加煩一下彼得潘問東問西<br>總有一天我一定能把之前沒寫完的作業通通寫完的ＸＤ</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c1d7bd580a8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/%E9%81%8E%E4%BA%86%E6%AE%B5%E6%99%82%E9%96%93%E6%89%8D%E5%AF%AB%E7%9A%84-%E5%BD%BC%E5%BE%97%E6%BD%98-ios-app%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88%E8%AA%B2%E7%A8%8B%E5%BF%83%E5%BE%97-4c1d7bd580a8">過了段時間才寫的-彼得潘 iOS 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[#7 Light App-簡單版]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/7-light-app-%E7%B0%A1%E5%96%AE%E7%89%88-6eb8b5b70fdb?source=rss-2ce273110de9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6eb8b5b70fdb</guid>
            <dc:creator><![CDATA[Jasmine Chen]]></dc:creator>
            <pubDate>Tue, 11 Jul 2017 08:31:58 GMT</pubDate>
            <atom:updated>2017-07-11T08:31:58.190Z</atom:updated>
            <content:encoded><![CDATA[<p>製作一個空白頁面 App，一開始畫面是白色。點選白色畫面將讓畫面變黑色，點選黑色畫面將讓畫面變白色。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*FSsdIs1lqBCjaHwcsx8NBw.gif" /></figure><ol><li>丟個Button進去，拉到最大<br>按鈕文字可留著可去掉</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FJQyCwf2pwlZjduVD18cTA.png" /></figure><p>2. 設定變數開燈ligntOn，Optional設定為true</p><pre>var lightOn = true</pre><p>3. 拉個@IBAction，輸入以下：<br> (1) lightOn = !lightOn，讓它的狀態相反<br> (2) 把if-else條件放進去，讓它的背景色為白色(.white)或是黑色(.black)</p><pre>@IBAction func buttonPress(_ sender: Any) {</pre><pre>   lightOn = !lightOn</pre><pre>   if lightOn{</pre><pre>      view.backgroundColor = .white</pre><pre>   }</pre><pre>   else{</pre><pre>      view.backgroundColor = .black</pre><pre>   }</pre><pre>}</pre><p>簡單版的這樣就搞定了～</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6eb8b5b70fdb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/7-light-app-%E7%B0%A1%E5%96%AE%E7%89%88-6eb8b5b70fdb">#7 Light 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[BMI計算機]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/bmi%E8%A8%88%E7%AE%97%E6%A9%9F-f8bdcb902067?source=rss-2ce273110de9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8bdcb902067</guid>
            <dc:creator><![CDATA[Jasmine Chen]]></dc:creator>
            <pubDate>Tue, 06 Jun 2017 13:12:57 GMT</pubDate>
            <atom:updated>2017-06-06T13:12:57.099Z</atom:updated>
            <content:encoded><![CDATA[<p>作業是小費計算機，<br>不過我覺得太沒挑戰性了所以就做了個BMI計算機</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*xyG1Oh9w-EeIUzjhiLJEzg.gif" /></figure><p>首先一樣，先放圖＆拉線<br>text的鍵盤使用Number Pad，Clear Button用is always visible<br>這次分成了可選擇性別、輸入身高、體重<br>（雖然性別只是裝飾用，沒有實際功能ＸＤ）<br>計算按下去後會顯示BMI值以及指針會指到相對應位置</p><pre>//男女顯示</pre><pre>@IBOutlet weak var gender: UISegmentedControl!</pre><pre>@IBOutlet weak var bgGirl: UIImageView!</pre><pre>@IBOutlet weak var bgBoy: UIImageView!</pre><pre>//身高體重輸入框</pre><pre>@IBOutlet weak var height: UITextField!</pre><pre>@IBOutlet weak var weight: UITextField!</pre><pre>//BMI結果</pre><pre>@IBOutlet weak var result: UILabel!</pre><pre>//胖瘦文字</pre><pre>@IBOutlet weak var ssText: UILabel!</pre><pre>@IBOutlet weak var sText: UILabel!</pre><pre>@IBOutlet weak var mText: UILabel!</pre><pre>@IBOutlet weak var lText: UILabel!</pre><pre>@IBOutlet weak var lLtext: UILabel!</pre><pre>//胖瘦指針</pre><pre>@IBOutlet weak var ssArrow: UIImageView!</pre><pre>@IBOutlet weak var sArrow: UIImageView!</pre><pre>@IBOutlet weak var mArrow: UIImageView!</pre><pre>@IBOutlet weak var lArrow: UIImageView!</pre><pre>@IBOutlet weak var lLArrow: UIImageView!</pre><p>首先先處理選擇男女的部分，拉selectedSegmentIndex的@IBAction<br>要使選擇『男』的時候跳出小藍人，選『女』的時候跳出粉紅人<br>我做了兩張圖片，分別是小藍人＋灰人的bgBoy、粉紅＋灰人的bgGirl<br>在選擇selectedSegmentIndex==0的時候，顯示bgBoy<br>另外一個選擇bgGirl<br>(這項只是裝飾用的，因為我懶得把性別因素也加入bmi計算～）</p><pre>@IBAction func genderSwitch(_ sender: Any) {</pre><pre>if gender.selectedSegmentIndex == 0{</pre><pre>bgBoy.isHidden = false</pre><pre>bgGirl.isHidden = true</pre><pre>}</pre><pre>else{</pre><pre>bgBoy.isHidden = true</pre><pre>bgGirl.isHidden = false</pre><pre>}</pre><pre>}</pre><p>接著處理最重要的計算bmi的部分<br>拉『計算ＢＭＩ』的@IBAction<br>先用if來處理如果身高體重欄沒有填入任何字的時候會跳出的警告訊息</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*4QMKxaML7IBxcJB3RffIPw.png" /></figure><pre>if height.text == “” || weight.text == “”{</pre><pre>let alertController = UIAlertController(title: “錯誤”, message: “請輸入身高體重”, preferredStyle: UIAlertControllerStyle.alert)</pre><pre>alertController.addAction(UIAlertAction(title: “OK”, style: UIAlertActionStyle.default, handler: nil))</pre><pre>present(alertController, animated: true, completion: nil)</pre><pre>}</pre><p>接著用else來做bmi的計算<br>bmi的算式為：體重(公斤) / 身高(公尺)的平方<br>因為一般習慣身高是用公分，所以要把輸入身高轉成公尺<br>設一個常數heightM為輸入身高的100分之一</p><pre>let heightM = Double(height.text!)!/100</pre><p>接著處理算式</p><pre>result.text = String(Double(weight.text!)!/(heightM * heightM))</pre><p>因為數字除以有小數點的數字總是會有一長串數字跟在後面，<br>所以要設定讓它只顯示到小數後一位<br>要加上 <strong>format:”%.1f”<br></strong>所以剛剛那串算式會變成：</p><pre>result.text = String(format:”%.1f”,Double(weight.text!)!/(heightM * heightM))</pre><p>接著在else裡面處理bmi值算出來後，<br>對應到你是過瘦、正常、過胖還是太胖了<br>（雖然有五個小人，不過只是為了排版美觀而已，<br>太瘦了的小人我沒有用，只有處理四個小人而已ＸＤ）<br>對應到的範圍數值，<br>會顯示胖瘦文字＆對應位置的小箭頭</p><pre>if Double(result.text!)!&lt;18.5{</pre><pre>sText.isHidden = false</pre><pre>sArrow.isHidden = false</pre><pre>}</pre><pre>else if Double(result.text!)!&gt;=18.5 &amp;&amp; Double(result.text!)!&lt;23.9{</pre><pre>mText.isHidden = false</pre><pre>mArrow.isHidden = false</pre><pre>}</pre><pre>else if Double(result.text!)!&gt;=23.9 &amp;&amp; Double(result.text!)!&lt;27.9{</pre><pre>lText.isHidden = false</pre><pre>lArrow.isHidden = false</pre><pre>}</pre><pre>else{</pre><pre>lLtext.isHidden = false</pre><pre>lLArrow.isHidden = false</pre><pre>}</pre><p>因為重複計算時已經出現的文字不會消失<br>所以要設定在觸發『計算ＢＭＩ』的@IBAction時會讓所有圖層為Hidden</p><pre>sArrow.isHidden = true</pre><pre>mArrow.isHidden = true</pre><pre>lArrow.isHidden = true</pre><pre>lLArrow.isHidden = true</pre><pre>sText.isHidden = true</pre><pre>mText.isHidden = true</pre><pre>lText.isHidden = true</pre><pre>lLtext.isHidden = true</pre><p>接著是收鍵盤的部分<br>一樣在『計算ＢＭＩ』的@IBAction，<br>設定觸發按鈕時會收鍵盤<br>記得兩個輸入欄都要設定，要不然其中一個會收不起來</p><pre>height.resignFirstResponder()</pre><pre>weight.resignFirstResponder()</pre><p>另一個收鍵盤的是要讓使用者在碰觸畫面其他地方時，<br>鍵盤會收起來<br>（這個超方便超直覺的功能居然不是預設這實在是太過分了）</p><pre>func hideKeyboardWhenTapAround(){</pre><pre>let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(ViewController.dismissKeyboard))</pre><pre>view.addGestureRecognizer(tap)</pre><pre>}</pre><pre>func dismissKeyboard(){</pre><pre>view.endEditing(true)</pre><pre>}</pre><p>最後，在viewDidLoad裡面把初始的值設定一下<br>讓開頭就顯示小藍人、<br>bmi初始值為0<br>鍵盤的設定也放一下</p><pre>override func viewDidLoad() {</pre><pre>super.viewDidLoad()</pre><pre>// Do any additional setup after loading the view, typically from a nib.</pre><pre>bgBoy.isHidden = false</pre><pre>self.hideKeyboardWhenTapAround()//按任意處收起鍵盤</pre><pre>result.text = “0”</pre><pre>}</pre><p><a href="https://github.com/jasmine888tw/BMICal">jasmine888tw/BMICal</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8bdcb902067" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/bmi%E8%A8%88%E7%AE%97%E6%A9%9F-f8bdcb902067">BMI計算機</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[問答題App — 動漫問答]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/%E5%95%8F%E7%AD%94%E9%A1%8Capp-%E5%8B%95%E6%BC%AB%E5%95%8F%E7%AD%94-ac8074ff3f33?source=rss-2ce273110de9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac8074ff3f33</guid>
            <dc:creator><![CDATA[Jasmine Chen]]></dc:creator>
            <pubDate>Thu, 01 Jun 2017 09:12:24 GMT</pubDate>
            <atom:updated>2017-06-01T09:12:24.369Z</atom:updated>
            <content:encoded><![CDATA[<p>雖然還是有點搞不懂struct跟array的用法<br>總之先實戰了再說!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*qsqQ_nhmt6y0WEbo0W1v7w.gif" /></figure><p>先做10個固定問題和固定順序的</p><p>首先，一定要做的就是先拉線連連看建立@IBOutlet</p><pre>@IBOutlet weak var quesNumber: UILabel!</pre><pre>@IBOutlet weak var quesLabel: UILabel!</pre><pre>@IBOutlet weak var ansLabel: UILabel!</pre><pre>@IBOutlet weak var cat1: UIImageView!</pre><pre>@IBOutlet weak var cat2: UIImageView!</pre><pre>@IBOutlet weak var showAns: UIButton!</pre><pre>@IBOutlet weak var nextQues: UIButton!</pre><p>接著建立struct<br>宣告 question跟 answer兩個變數，初始值為空白</p><pre>struct Qna {</pre><pre>var question = “”</pre><pre>var answer = “”</pre><p>接著列出一個存取題目跟答案的陣列<br>並宣告變數count的初始值為0<br>讓題目從陣列中的第一個值開始讀取<br>題目是從遊戲『黑貓』的題庫裡面隨便抓的</p><pre>var qnaArray = [Qna(question: “「XBOX」是哪家公司開發的？”, answer: “微軟”),</pre><pre>Qna(question: “「瑪麗歐兄弟」主角帽子上寫的英文字母是？”, answer: “M”),</pre><pre>Qna(question: “「光速蒙面俠21」中，主角所屬的隊伍是？”, answer: “泥門惡魔蝙蝠隊”),</pre><pre>Qna(question: “「南方四賤客」裡穿著橘色外套的人是誰？”, answer: “肯尼”),</pre><pre>Qna(question: “「火影忍者」中，日向寧次的血繼界限是？”, answer: “白眼”),</pre><pre>Qna(question: “「怪醫黑傑克」中，黑傑克的小助手名字叫什麼？”, answer: “皮諾可”),</pre><pre>Qna(question: “哪一種族屬於「魔獸世界WOW」中的「中立陣營」？”, answer: “熊貓人”),</pre><pre>Qna(question: “《銀之匙》中，女主角御影亞紀最喜歡的動物是什麼？”, answer: “馬”),</pre><pre>Qna(question: “《麵包超人》裡，麵包超人最大的敵人是誰？”, answer: “細菌人”),</pre><pre>Qna(question: “《庫洛魔法使》的小櫻每次對戰時所穿的衣服是由誰所設計的？”, answer: “知世”),</pre><pre>]</pre><p>接著用按鈕的@IBAction<br>簡化【陣列-問答題(PTT鄉民實測)】的操作<br>讓next question還有show answer在同一個位置上<br>nextQues觸發，nextQues按鈕消失，showAns出現<br>showAns觸發，showAns按鈕出現，nestQues出現<br>這樣只要按同一個地方就能快速瀏覽了（懶人一個</p><pre>//秀答案</pre><pre>@IBAction func showAns(_ sender: Any) {</pre><pre>cat1.isHidden = true</pre><pre>cat2.isHidden = false</pre><pre>ansLabel.isHidden = false</pre><pre>showAns.isHidden = true</pre><pre>nextQues.isHidden = false</pre><pre>}</pre><pre>//下一題</pre><pre>@IBAction func nextQues(_ sender: Any) {</pre><pre>count += 1</pre><pre>if count == 10{</pre><pre>count = 0</pre><pre>}</pre><pre>nextQuestion()</pre><pre>cat1.isHidden = false</pre><pre>cat2.isHidden = true</pre><pre>showAns.isHidden = false</pre><pre>nextQues.isHidden = true</pre><pre>}</pre><p><a href="https://github.com/jasmine888tw/10question">jasmine888tw/10question</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac8074ff3f33" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/%E5%95%8F%E7%AD%94%E9%A1%8Capp-%E5%8B%95%E6%BC%AB%E5%95%8F%E7%AD%94-ac8074ff3f33">問答題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[結合 outlet 和 action｜你是RPG的誰]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/%E7%B5%90%E5%90%88-outlet-%E5%92%8C-action-%E4%BD%A0%E6%98%AFrpg%E7%9A%84%E8%AA%B0-a97e4bd3433?source=rss-2ce273110de9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a97e4bd3433</guid>
            <dc:creator><![CDATA[Jasmine Chen]]></dc:creator>
            <pubDate>Tue, 23 May 2017 09:53:40 GMT</pubDate>
            <atom:updated>2017-05-24T03:41:08.933Z</atom:updated>
            <content:encoded><![CDATA[<p>這次的作業是要運用outlet&amp;action來做支擇偶的APP<br>不過我想做些別的<br>經過幾次作業後發現自己好像特別偏好RPG系列耶…？</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*8e7-y7pp7HIeNyEFRSul3Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*ipWI8G461niiaLU8YCKxeQ.gif" /></figure><ol><li><strong>基本該做的圖片＆該拉的@IBOutlet拉一拉</strong><br>(1)這次的圖片分別為：初始的問號人、村民、嘍嘍、勇者、魔王、外框、中間的傳說按鈕、還有只有結果為魔王時的重來一次按鈕。<br>(2)來到storyboard：<br>底層的view設定為00CDBD藍綠色，另外多拉一個可以蓋住問號人的藍綠色View。把Label、text field、switch、slide、segmented control放上去<br>(3)圖層堆疊順序為：<br>-底層view、<br>-問號人、Label們<br>-第二層藍綠色view<br>-村民、嘍嘍、勇者<br>-中間的傳說按鈕<br>-魔王圖片<br>-外框、重來一次按鈕、Label、text field、switch、slide、segmented<br>(4)把村民、嘍嘍、勇者、魔王、第二層藍綠色view、重來一次按鈕給Hidden藏起來</li><li><strong>處理switch和slide的設定<br>(1)Tint顏色更改</strong><br>Switch顏色用On Tint更改成黃色（如果要改拖拉鈕的話要改Thumb Tint)<br>Slide顏色用Tint更改成黃色<br> <br>(2)<strong> 把值傳到label</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*so5Pwx_wDrN5PeRWl6Jj2A.png" /></figure><pre>@IBAction func ageSlider(_ sender: Any) {</pre><pre>agelabel.text = “\(Int(age.value))”</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UMo7Z_yTQ1YDCcWdMY1Zxg.png" /></figure><pre>@IBAction func swish(_ sender: UISwitch) {</pre><pre>if (sender.isOn) == true{</pre><pre>humanText.text = “我是人類”</pre><pre>}</pre><pre>else{</pre><pre>humanText.text = “我不是人類”</pre><pre>}</pre><pre>}</pre><p>3. <strong>按下『我是傳說中的…』按鈕語法</strong></p><blockquote><strong>先設定好規則：<br></strong>勇者（人類/年齡&lt;100/世界-讚) <br>魔王（非人類/年齡=666/世界-爛）<br>村民（人類/年齡&lt;100）<br>嘍嘍（其他）</blockquote><p>把『我是傳說中的…』按鈕拉@IBAction開始做if-else</p><pre>@IBAction func imWhat(_ sender: Any) {</pre><pre>if switchHuman.isOn &amp;&amp; age.value&lt;100 &amp;&amp; world.selectedSegmentIndex==0{</pre><pre>    blankBlue.isHidden = false</pre><pre>    ansDevil.isHidden = true</pre><pre>    ansVillager.isHidden = true</pre><pre>    ansBraver.isHidden = false//勇者</pre><pre>    ansBad.isHidden = true</pre><pre>}</pre><pre>else if switchHuman.isOn &amp;&amp; age.value&lt;100 &amp;&amp; world.selectedSegmentIndex==2{</pre><pre>    blankBlue.isHidden = false</pre><pre>    ansDevil.isHidden = true</pre><pre>    ansVillager.isHidden = false//村民</pre><pre>    ansBraver.isHidden = true</pre><pre>    ansBad.isHidden = true</pre><pre>}</pre><pre>else if switchHuman.isOn==false &amp;&amp; age.value==666 &amp;&amp; world.selectedSegmentIndex==1{</pre><pre>    blankBlue.isHidden = false</pre><pre>    ansDevil.isHidden = false//魔王</pre><pre>    ansVillager.isHidden = true</pre><pre>    ansBraver.isHidden = true</pre><pre>    ansBad.isHidden = true</pre><pre>}</pre><pre>else{</pre><pre>    blankBlue.isHidden = false</pre><pre>    ansDevil.isHidden = true</pre><pre>    ansVillager.isHidden = true</pre><pre>    ansBraver.isHidden = true</pre><pre>    ansBad.isHidden = false//嘍嘍<br>}</pre><pre>}</pre><p>雖然說魔王那張圖會擋到原本的傳說按鈕，但是view不會擋到按鈕觸發<br>所以不用再另外處理傳說按鈕喔～</p><p><a href="https://github.com/jasmine888tw/selectRPG">jasmine888tw/selectRPG</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a97e4bd3433" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/%E7%B5%90%E5%90%88-outlet-%E5%92%8C-action-%E4%BD%A0%E6%98%AFrpg%E7%9A%84%E8%AA%B0-a97e4bd3433">結合 outlet 和 action｜你是RPG的誰</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[[swift] 練習計算格子內數字的總和]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/swift-%E7%B7%B4%E7%BF%92%E8%A8%88%E7%AE%97%E6%A0%BC%E5%AD%90%E5%85%A7%E6%95%B8%E5%AD%97%E7%9A%84%E7%B8%BD%E5%92%8C-9d9a373cd007?source=rss-2ce273110de9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d9a373cd007</guid>
            <dc:creator><![CDATA[Jasmine Chen]]></dc:creator>
            <pubDate>Mon, 22 May 2017 04:35:10 GMT</pubDate>
            <atom:updated>2017-05-22T04:35:10.570Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_3gz3d5BqRucMQh-8C0Ag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FeHI6wZjvcCRgNp-zKbj1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aFg_wGMbf_MW4B2D0QH8cg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3MOjGhc67KvAwO7KlVBhPQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KGhjhzfntlSk5cznaeIupA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FuJT5-lFVluTW8JO7Xi_AA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DJTKZwSK-hSVmnogQFmIpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c60kOimmK8CyWsjECL2g8A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l_jCVr-sjB3HNWvNiQjGCw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d9a373cd007" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/swift-%E7%B7%B4%E7%BF%92%E8%A8%88%E7%AE%97%E6%A0%BC%E5%AD%90%E5%85%A7%E6%95%B8%E5%AD%97%E7%9A%84%E7%B8%BD%E5%92%8C-9d9a373cd007">[swift] 練習計算格子內數字的總和</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>