<?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 Hohsin on Medium]]></title>
        <description><![CDATA[Stories by Hohsin on Medium]]></description>
        <link>https://medium.com/@hohsin1023?source=rss-0ea3e4efa498------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VNlT3ZFOyf8c1PyC</url>
            <title>Stories by Hohsin on Medium</title>
            <link>https://medium.com/@hohsin1023?source=rss-0ea3e4efa498------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 09:25:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hohsin1023/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[#05 多頁面電子書| 鋼琴家之書：從四個時期認識鋼琴家]]></title>
            <link>https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88/05-%E5%A4%9A%E9%A0%81%E9%9D%A2%E9%9B%BB%E5%AD%90%E6%9B%B8-%E9%8B%BC%E7%90%B4%E5%AE%B6%E4%B9%8B%E6%9B%B8-%E5%BE%9E%E5%9B%9B%E5%80%8B%E6%99%82%E6%9C%9F%E8%AA%8D%E8%AD%98%E9%8B%BC%E7%90%B4%E5%AE%B6-8adaec52bf19?source=rss-0ea3e4efa498------2</link>
            <guid isPermaLink="false">https://medium.com/p/8adaec52bf19</guid>
            <dc:creator><![CDATA[Hohsin]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 08:30:44 GMT</pubDate>
            <atom:updated>2026-11-16T08:30:44.918Z</atom:updated>
            <content:encoded><![CDATA[<p>GitHub 連結：<a href="https://github.com/hsin1023/pianist_introduction">pianist_introduction</a><br>Youtube 連結：<a href="https://youtube.com/shorts/xNeOW7Tvo_g">pianist_introduction</a></p><h3>一、創作發想</h3><p>相信大家小時候音樂課應該都看過「古典魔力客」，這系列的影片介紹了許許多多的古典音樂家。其實我已經忘記小時候為什麼會喜歡看這些影片，但從小就開始學鋼琴的我，在學琴的過程以及現在聽到古典音樂偶爾有的感動，開始讓我對他們生活在什麼時代、為什麼會寫出這樣的音樂產生了興趣。所以這次想做一本可以放在手機裡的「鋼琴家之書」，從人物的故事開始認識作品。</p><p>我把內容分成巴洛克、古典、浪漫與二十世紀以後四個時期，每個時期選了 10 位人物。雖然書名叫鋼琴家之書，但巴洛克時期的鋼琴還沒有普及，因此那一部分也收錄了以大鍵琴和管風琴創作的鋼琴家。</p><h3>二、App 畫面與操作</h3><p>第一次開啟 App 時，會先看到開頭畫面，以及三頁可以左右滑動的簡短導覽。進入首頁後，可以從四個時期一路點進人物列表，再閱讀人物生平和三首代表作品的介紹。</p><p>如果已經知道想找誰，也可以到「全部人物」搜尋。人物介紹頁右上角的愛心可以加入收藏；「聆聽音樂」分頁則會開啟 Apple Music Classical 的作曲家目錄。首頁還會從尚未收藏的人物中隨機推薦一位，按「開始閱讀」就能直接進入他的介紹頁。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2NVGK6lA5mdn7tkkl5cH6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cS7rWMJ3-5DwUZyU6w93_w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hg4LDr4DkpChCMdY2DbToA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XZ79X3cTLA82vMapOH1bWA.png" /><figcaption>iphone 頁面</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dq2WIQ7YaYJd7Q-ylCWhLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b8GGITGruVRT4LINGPHZXA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*axdqLFfovBMeG6MBuGacwA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pvA81rR3NgWbP3zEwFuOzQ.png" /><figcaption>ipad 頁面</figcaption></figure><p><a href="https://youtube.com/shorts/xNeOW7Tvo_g">https://youtube.com/shorts/xNeOW7Tvo_g</a></p><h3>三、作業要求</h3><h3>1. 新增檔案定義頁面</h3><p>我把首頁、時期列表、人物介紹、搜尋、收藏、聆聽音樂和首次導覽拆成不同的 View。人物資料也依四個時期分成四個 Swift 檔案。這樣要修改其中一個畫面或補一位人物時，比較好找到。</p><p>顏色與字型集中放在 BookStyle，目前使用的是 Noto Serif TC，搭配接近紙張的底色和黃銅色：</p><pre>enum BookStyle {<br>    static let paper = Color(red: 0.91, green: 0.91, blue: 0.89)<br>    static let ink = Color(red: 0.09, green: 0.09, blue: 0.08)<br>    static let brass = Color(red: 0.59, green: 0.53, blue: 0.10)</pre><pre>    static func title(_ size: CGFloat) -&gt; Font {<br>        .custom(&quot;NotoSerifTC-Regular&quot;, size: size).weight(.semibold)<br>    }</pre><pre>    static func text(_ size: CGFloat) -&gt; Font {<br>        .custom(&quot;NotoSerifTC-Regular&quot;, size: size)<br>    }<br>}</pre><h3>2. 使用 TabView 與 Tab</h3><p>App 有「時代分期」、「全部人物」、「我的收藏」和「聆聽音樂」四個分頁。每個分頁各自包在 NavigationStack 裡，切換 tab 後可以繼續在該分頁內換頁：</p><pre>TabView {<br>    Tab(&quot;時代分期&quot;, systemImage: &quot;books.vertical&quot;) {<br>        NavigationStack { EraHomeView() }<br>    }<br>    Tab(&quot;全部人物&quot;, systemImage: &quot;magnifyingglass&quot;) {<br>        NavigationStack { PianistSearchView() }<br>    }<br>    Tab(&quot;我的收藏&quot;, systemImage: &quot;heart&quot;) {<br>        NavigationStack {<br>            FavoritesView(pianists: PianistCatalog.all.filter {<br>                favoriteIDs.contains($0.id)<br>            })<br>        }<br>    }<br>    Tab(&quot;聆聽音樂&quot;, systemImage: &quot;music.note&quot;) {<br>        NavigationStack { ListeningView() }<br>    }<br>}<br>.tint(BookStyle.brass)</pre><h3>3. 使用 NavigationStack、`NavigationLink` 傳資料與顯示標題</h3><p>在時期列表點一位人物時，`NavigationLink` 會傳入他的 id。下一頁再從資料陣列找到對應的 Pianist，交給介紹頁使用。導覽列的標題則顯示目前的時期或人物姓名：</p><pre>List(pianists) { pianist in<br>    NavigationLink(value: pianist.id) {<br>        PianistRow(pianist: pianist)<br>    }<br>}<br>.navigationDestination(for: String.self) { id in<br>    if let pianist = PianistCatalog.all.first(where: { $0.id == id }) {<br>        PianistDetailView(pianist: pianist)<br>    }<br>}<br>.navigationTitle(era.rawValue)</pre><h3>4. 用 struct、`Identifiable` 和 Array 整理資料</h3><p>一位人物需要姓名、年代、時期、生平和作品；一首作品則需要名稱和介紹，所以我把它們分成兩個 struct：</p><pre>struct MusicalWork: Identifiable {<br>    let title: String<br>    let note: String<br>    var id: String { title }<br>}</pre><pre>struct Pianist: Identifiable {<br>    let id: String<br>    var portraitName: String { &quot;Pianist-\(id)&quot; }<br>    let name: String<br>    let originalName: String<br>    let tagline: String<br>    let years: String<br>    let era: MusicEra<br>    let biography: String<br>    let works: [MusicalWork]<br>}</pre><p>四個時期各有自己的資料 Array，最後由 PianistCatalog.all 合併。照片資源的名稱則用人物 id 組成，新增或替換照片時比較容易對應：</p><pre>enum PianistCatalog {<br>    static let all: [Pianist] =<br>        BaroquePianists.all<br>        + ClassicalPianists.all<br>        + RomanticPianists.all<br>        + ModernPianists.all<br>}</pre><h3>5. 使用 List 製作人物表格</h3><p>時期人物列表、全部人物和收藏頁都使用 List。列的內容共用 PianistRow，左邊是肖像，中間用一條黃銅色直線隔開，右邊顯示名字與年代：</p><pre>HStack(spacing: sizeClass == .regular ? 20 : 13) {<br>    PianistPortrait(<br>        pianist: pianist,<br>        width: sizeClass == .regular ? 112 : 86,<br>        height: sizeClass == .regular ? 112 : 96<br>    )</pre><pre>    BookStyle.brass.frame(<br>        width: 3,<br>        height: sizeClass == .regular ? 82 : 70<br>    )</pre><pre>    VStack(alignment: .leading, spacing: 6) {<br>        Text(pianist.name)<br>            .font(BookStyle.title(sizeClass == .regular ? 27 : 22))</pre><pre>        Text(&quot;\(pianist.originalName) · \(pianist.years)&quot;)<br>            .font(BookStyle.text(sizeClass == .regular ? 15 : 13))<br>    }<br>}</pre><h3>6. 用 page 實現水平滑動</h3><p>首次導覽使用三頁 TabView，搭配 .page 樣式。可以左右滑，也可以按下方的「下一頁」；到了最後一頁，按鈕會變成「開始探索」：</p><pre>TabView(selection: $page) {<br>    IntroPage(<br>        title: &quot;鋼琴家之書&quot;,<br>        detail: &quot;走進琴鍵背後的生命與時代&quot;<br>    ).tag(0)</pre><pre>    IntroPage(<br>        title: &quot;循著時代閱讀&quot;,<br>        detail: &quot;從巴洛克的鍵盤樂器，到二十世紀的鋼琴新聲。&quot;<br>    ).tag(1)</pre><pre>    IntroPage(<br>        title: &quot;收藏你的篇章&quot;,<br>        detail: &quot;認識作曲家、閱讀代表作品，再前往聆聽。&quot;<br>    ).tag(2)<br>}<br>.tabViewStyle(.page(indexDisplayMode: .always))</pre><h3>7. 使用 WebView 顯示網頁</h3><p>「聆聽音樂」分頁使用 WKWebView 顯示 <a href="https://classical.music.apple.com/tw/browse/composers">Apple Music Classical 作曲家目錄</a>。因為這是 UIKit 的元件，我用 UIViewRepresentable 把它放進 SwiftUI 畫面：</p><pre>struct ClassicalWebView: UIViewRepresentable {<br>    let url: URL</pre><pre>    func makeUIView(context: Context) -&gt; WKWebView {<br>        let view = WKWebView()<br>        view.load(URLRequest(url: url))<br>        return view<br>    }</pre><pre>    func updateUIView(_ view: WKWebView, context: Context) {}<br>}</pre><h3>8. 設定開頭畫面</h3><p>開頭畫面使用 LaunchScreen.storyboard，其中放入 LaunchArt 圖片。專案的設定也指定了 launch storyboard：</p><pre>INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;</pre><p>這個畫面和首次使用的三頁導覽不同：launch screen 是 App 啟動時先顯示的畫面，導覽頁則是進入 App 後可以操作的內容。</p><h3>9. 截圖 iPhone 與 iPad 畫面</h3><p>我分別在 iPhone 和 iPad 模擬器截圖。後來加入 40 位人物肖像後，也重新拍了 iPad 的首頁、人物列表與介紹頁，確認平板上不會仍顯示舊的鋼琴封面圖。</p><h3>四、遇到的問題</h3><p>一開始做首頁時，我把「鋼琴家之書」也放進固定區域，結果往下滑之後它會一直留在畫面上擋住內容。後來調整成首頁標題跟著畫面滑動，只有四大時期的章節標題固定。</p><p>圖片也花了一些時間處理。40 位人物的照片原始檔名有空格和重音符號，如果直接靠檔名讀取，很容易對不到資料。最後改用人物的固定 id 組成圖片資源名稱，再讓首頁、列表與介紹頁共用同一個肖像元件：</p><pre>struct PianistPortrait: View {<br>    let pianist: Pianist<br>    let width: CGFloat<br>    let height: CGFloat</pre><pre>    var body: some View {<br>        Image(pianist.portraitName)<br>            .resizable()<br>            .scaledToFill()<br>            .frame(width: width, height: height)<br>            .clipped()<br>    }<br>}</pre><h3>五、心得</h3><p>這次做完後，我覺得最花時間的地方還是怎麼讓資料（程式碼）是清晰可讀的。如果 40 個人全部寫在同一個檔案，後面要找或修改內容會非常痛苦，但是分成四個時期後，整理起來就方便很多。照片也是一樣，先決定好對應規則，後續要替換圖片就不用每個畫面都改一次。</p><p>我也發現同一套介面在手機和平板上，文字、照片與留白看起來會有不同感覺，所以不能只確認 iPhone 能跑就算完成。之後如果還要延伸，我希望可以加入作品的試聽連結，讓閱讀人物故事和實際聆聽音樂之間的距離再短一點。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8adaec52bf19" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88/05-%E5%A4%9A%E9%A0%81%E9%9D%A2%E9%9B%BB%E5%AD%90%E6%9B%B8-%E9%8B%BC%E7%90%B4%E5%AE%B6%E4%B9%8B%E6%9B%B8-%E5%BE%9E%E5%9B%9B%E5%80%8B%E6%99%82%E6%9C%9F%E8%AA%8D%E8%AD%98%E9%8B%BC%E7%90%B4%E5%AE%B6-8adaec52bf19">#05 多頁面電子書| 鋼琴家之書：從四個時期認識鋼琴家</a> was originally published in <a href="https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88">台大 iOS App 程式設計</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#04 隨機 App | Kpop intro 介紹一個 K-pop 團體]]></title>
            <link>https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88/04-%E9%9A%A8%E6%A9%9F-app-kpop-intro-%E4%BB%8B%E7%B4%B9%E4%B8%80%E5%80%8B-k-pop-%E5%9C%98%E9%AB%94-090128201ac2?source=rss-0ea3e4efa498------2</link>
            <guid isPermaLink="false">https://medium.com/p/090128201ac2</guid>
            <dc:creator><![CDATA[Hohsin]]></dc:creator>
            <pubDate>Fri, 23 Oct 2026 04:20:21 GMT</pubDate>
            <atom:updated>2026-10-23T04:20:21.166Z</atom:updated>
            <content:encoded><![CDATA[<h3>隨機 App | Kpop intro 介紹一個 K-pop 團體</h3><p>github 連結：<a href="https://github.com/hsin1023/kpop_intro">kpop intro</a><br>youtube 連結：<a href="https://youtube.com/shorts/muPCq0zOXIE">kpop_intro</a></p><h4>一、創作發想</h4><p>大概從高中開始，因著 ig reels, youtube shorts 的興起，K-pop culture 爆發式流行於學生之間，我也是這時候和同學一起接觸到 K-pop，這群同學挺逗的，我們偶爾也會拍一些什麼舞蹈 challenge 之類的，然後出去玩的時候一直在猜 K-pop 歌，總之算是一段蠻有趣的回憶（？）。</p><p>上大學之後發現身邊的人好像大家對這個 K-pop 比較還好，而且每次推我喜歡的團給別人都要講一大堆（NMIXX 一生推），所以想說就做一個介紹 K-pop 女團的 app 吧。</p><h4>二、App 畫面與操作</h4><p>以下是操作畫面的 demo，顯示抽卡以及女團介紹頁面。</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2FmuPCq0zOXIE&amp;type=text%2Fhtml&amp;schema=youtube&amp;display_name=YouTube&amp;src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmuPCq0zOXIE%3Ffeature%3Doembed" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/683da8598c912744a7417165109603cb/href">https://medium.com/media/683da8598c912744a7417165109603cb/href</a></iframe><p>以下是首頁以及女團小卡的頁面</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8SBgjQ8FrR_4zmsTuU2J5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0_yGrJowq5wb5YNbBtHP8Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*umr7A7owSn0Ib5gHW8G9dQ.png" /></figure><p>操作很簡單，只要按下下方的 Draw 就會隨機抽取一張女團小卡，裡面包含整團簡單的介紹、成員以及專輯，同時，在抽到該團的小卡時，也會播放一小段該團歌曲，在這次作業中，我選了五個團體，分別是：NMIXX, TWICE, aespa, IVE, LE SSERAFIM。</p><h4>三、程式 — 主要架構</h4><p>在這次的作業中，除了像上次一樣分成許多 View 方便管理以外，因為每個女團的介紹模板都一樣，所以就用 GirlGroup 儲存每一個女團的資訊，並且每一團也都有 Member 以及 Album，所以大架構就是先把這三個分別都做一個 struct，這樣後續建立團體資訊就會很快，以下是三個 struct 分別的變數內容：</p><pre>struct GirlGroup: Identifiable, Hashable {<br>    let id: String<br>    let name: String<br>    let debutDescription: String<br>    let summary: String<br>    let musicFileName: String<br>    let profileImageName: String<br>    let profileCrop: AssetCrop<br>    let members: [Member]<br>    let albums: [Album]<br>}<br><br>struct Member: Identifiable, Hashable {<br>    let id: String<br>    let name: String<br>    let role: String<br>    let imageName: String<br>    let crop: AssetCrop<br>}<br><br>struct Album: Identifiable, Hashable {<br>    let id: String<br>    let name: String<br>    let imageName: String<br>    let crop: AssetCrop<br>}</pre><p>藉著 struct，在建立資訊就會方便很多，以 NMIXX 為例，使用方法如下：</p><pre>    static let nmixx = GirlGroup(<br>        id: &quot;nmixx&quot;,<br>        name: &quot;NMIXX&quot;,<br>        debutDescription: &quot;JYP Entertainment · 2022 · 6 members&quot;,<br>        summary: &quot;NMIXX 是以多變曲風與強勁現場實力受到矚目的六人女子團體。她們把不同音樂類型融合成獨特的 MIXX POP，讓每次回歸都有意想不到的新面貌。&quot;,<br>        musicFileName: &quot;NMIXXMusic&quot;,<br>        profileImageName: &quot;NmixxProfile&quot;,<br>        profileCrop: AssetCrop(focalX: 0.50, focalY: 0.48, zoom: 1.02),<br>        members: [<br>            Member(id: &quot;nmixx-lily&quot;, name: &quot;Lily&quot;, role: &quot;Vocal&quot;, imageName: &quot;MemberLily&quot;, crop: AssetCrop(focalX: 0.58, focalY: 0.27, zoom: 1.05)),<br>            Member(id: &quot;nmixx-haewon&quot;, name: &quot;Haewon&quot;, role: &quot;Leader · Vocal&quot;, imageName: &quot;MemberHaewon&quot;, crop: AssetCrop(focalX: 0.50, focalY: 0.34, zoom: 1.05)),<br>            Member(id: &quot;nmixx-sullyoon&quot;, name: &quot;Sullyoon&quot;, role: &quot;Vocal&quot;, imageName: &quot;MemberSullyoon&quot;, crop: AssetCrop(focalX: 0.50, focalY: 0.30, zoom: 1.04)),<br>            Member(id: &quot;nmixx-bae&quot;, name: &quot;Bae&quot;, role: &quot;Vocal · Dance&quot;, imageName: &quot;MemberBae&quot;, crop: AssetCrop(focalX: 0.56, focalY: 0.34, zoom: 1.03)),<br>            Member(id: &quot;nmixx-jiwoo&quot;, name: &quot;Jiwoo&quot;, role: &quot;Rap · Dance&quot;, imageName: &quot;MemberJiwoo&quot;, crop: AssetCrop(focalX: 0.50, focalY: 0.42, zoom: 1.08)),<br>            Member(id: &quot;nmixx-kyujin&quot;, name: &quot;Kyujin&quot;, role: &quot;Dance · Vocal&quot;, imageName: &quot;MemberKyujin&quot;, crop: AssetCrop(focalX: 0.50, focalY: 0.33, zoom: 1.08))<br>        ],<br>        albums: [<br>            Album(id: &quot;nmixx-blue-valentine&quot;, name: &quot;Blue Valentine&quot;, imageName: &quot;AlbumBlueValentine&quot;, crop: .center),<br>            Album(id: &quot;nmixx-heavy-serenade&quot;, name: &quot;Heavy Serenade&quot;, imageName: &quot;AlbumHeavySerenade&quot;, crop: .center),<br>            Album(id: &quot;nmixx-strange-muse&quot;, name: &quot;Strange Muse&quot;, imageName: &quot;AlbumStrangeMuse&quot;, crop: .center)<br>        ]<br>    )</pre><p>這樣建立的每個團的小卡風格就會保持一致，並且無論是新增還是修改都會快很多。</p><h4>四、隨機抽取</h4><p>抽取小卡的部分使用了 randomElement()，為了避免連續抽到相同的團，因此使用 filter 以及紀錄上一個團的方法來實作，抽到之後也會播對應的 music：</p><pre>    private func drawGroup() {<br>        var availableGroups = groups<br><br>        if groups.count &gt; 1 {<br>            availableGroups = groups.filter { group in<br>                group.id != lastDrawnGroupID<br>            }<br>        }<br><br>        if let newGroup = availableGroups.randomElement() {<br>            lastDrawnGroupID = newGroup.id<br>            playMusic(fileName: newGroup.musicFileName)<br>            selectedGroup = newGroup<br>        }<br>    }</pre><h4>五、畫面呈現方式</h4><p>經過上一次的作業，我知道自己排版大概會做出對別人眼睛很抱歉的 UI，因此我先請 AI 幫我畫出一個比較柔和的版面，並做出一個雛形，後續我只需要將 struct 需要的東西寫好就好。</p><p>寫完第一版後，發現因為我挑的照片長寬不一樣，並且每個照片的人臉都在不同的地方，想到不可能每個都要一張一張調吧，因此就請 AI 幫我確認是否可以做出一個與 struct 概念一樣，我只要輸入參數就可以快速幫我調整照片的呈現方式，於是他做出了：</p><pre>struct AssetCrop: Hashable {<br>    let focalX: CGFloat<br>    let focalY: CGFloat<br>    let zoom: CGFloat<br><br>    static let center = AssetCrop(focalX: 0.5, focalY: 0.5, zoom: 1)<br>}</pre><p>就可以透過輸入 (x, y, zoom) 來調整顯示照片的哪一個部分，以及放大縮小。</p><p>最後想說如果抽到卡就這樣乾乾的看好像不太對，因此找了每一個團體我自己比較喜歡或有印象的音樂片段，讓 AI 幫我做成抽到該團時就會播放音樂，就完成了整個隨機 App 的製作。</p><h4>六、心得與延伸</h4><p>做完這次作業後，我發現對我來說最難的不是怎麼把程式的邏輯與架構寫好（可能是因為目前都還算呈現資料），反而 UI 設計的部分以及該如何精簡資料讓使用者願意看才是最難的，不過現在有 AI 的幫助算是方便許多，像是調整照片的部分因為每一張的格式都不同，如果要一張一張調就捨棄了 struct 的簡潔，因此讓我猶豫了許久，後來看到 AI 使用另外一個 struct 來調整 picture 呈現方式就讓我知道原來還可以這樣做。</p><p>我覺得能延伸的部分大概就是首頁或許可以在呈現多一點資料（例如簡單的各團封面等），針對每個成員以及專輯也可以再做更多的介紹，或是做一個類似 Community 的功能，讓每一團的粉絲可以在上面互相分享資訊應該挺不錯的。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=090128201ac2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88/04-%E9%9A%A8%E6%A9%9F-app-kpop-intro-%E4%BB%8B%E7%B4%B9%E4%B8%80%E5%80%8B-k-pop-%E5%9C%98%E9%AB%94-090128201ac2">#04 隨機 App | Kpop intro 介紹一個 K-pop 團體</a> was originally published in <a href="https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88">台大 iOS App 程式設計</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#03 About 頁面：新加坡飛禽公園介紹]]></title>
            <link>https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88/03-about-%E9%A0%81%E9%9D%A2-%E6%96%B0%E5%8A%A0%E5%9D%A1%E9%A3%9B%E7%A6%BD%E5%85%AC%E5%9C%92%E4%BB%8B%E7%B4%B9-fb2237e281d0?source=rss-0ea3e4efa498------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb2237e281d0</guid>
            <dc:creator><![CDATA[Hohsin]]></dc:creator>
            <pubDate>Sun, 18 Oct 2026 13:24:34 GMT</pubDate>
            <atom:updated>2026-10-18T13:24:34.446Z</atom:updated>
            <content:encoded><![CDATA[<p>Github 連結：<a href="https://github.com/hsin1023/Bird_paradise.git">https://github.com/hsin1023/Bird_paradise</a><br>展示連結：<a href="https://youtube.com/shorts/zt_O2xESAlM?si=E5HDJ9woRPr9Hwo2">https://youtube.com/shorts/zt_O2xESAlM?si=E5HDJ9woRPr9Hwo2</a></p><p>介紹內容參考：<br><a href="https://www.chuangfoo.org/contents/text?id=149">https://www.chuangfoo.org/contents/text?id=149</a><br><a href="https://www.bring-you.info/zh-tw/singapore-bird-paradise">https://www.bring-you.info/zh-tw/singapore-bird-paradise</a></p><h4>一、主題選擇</h4><p>在今年 2 月時，我和我的家人一起到新加坡玩，在查詢夜間動物園附近的景點時看到一個蠻不起眼的地標叫做 “bird paradise”，因為要從市區到夜間動物園附近其實蠻不方便的，於是當時就想說不如把這兩個地方放在同一天去。</p><p>實際逛完 bird paradise 後，我發現他對興趣是賞鳥和拍照的人真的是一個 paradise，因為當天有下雨，沒有辦法在很悠閒的情況下邊拍邊逛，不過即使是這樣我們也待在那邊接近四個小時。</p><p>想說 bird paradise 如此有趣的景點卻鮮少有人知道真的是太可惜了，於是想以這個園區當作主題做一個 About 頁面來介紹他。</p><h4>二、App 設計與實際畫面</h4><p>說實話，我對我自己的美感（設計）是相當的有信心，大概有 100% 的把握做出來不咋滴，所以我就參考了老師的 Disney 介紹，將園區照片、封面以及地圖列出來，在後續也是延續了前面的風格，因著背景放了與官方網站類似的背景，因此需要再調整 opacity，確保字體會是清楚的。</p><p>為了讓使用者使用 App 的同時也可以直接看到官網，以及當使用者想購票時能導向購票網站，我在標題 “Bird Paradise” 以及購票資訊的地方使用 markdown 讓使用者點擊就可以導向外部網站。</p><p>在全部的頁面（介紹）做完後，我請 AI 幫我做些微調整，使其可以與 darkmode 適配，因為我使用的顏色都相對簡單，因此大改只做了將固定顏色的 modifier 調整成使用 regularMaterial，而因為在寫程式時有使用 property 和 view，所以只要改動一兩個地方就可以改動全部了，實際畫面如下。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dx5HOjP6_6Xt4J6CMTfpxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mYjHlQJ0N8MGW7w3xEhrXQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZFJvwVG4KYycBeMLxeb6QA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hcrUcyd2Tcmya2DLtj4Nw.png" /><figcaption>Light Mode</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ih0ByG77GuydpJBUAL2WQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*47qPy6dzL5RezVzR82tlyg.png" /><figcaption>Dark Mode</figcaption></figure><h4>三、程式實作</h4><p>在這次的作業裡，我覺得除了練習 ZStack, VStack, HStack, ScrollView 等 function 以及其 modifier 的調整以外，更重要的是如何透過分成不同的 View 以及 Property 來讓自己的程式保持 consistency 和 simplicity。<br>因此在實際開始寫程式前，我先大致規劃了應該分成幾個 View 以及可能會使用到的 Property。</p><p>在這次的作業中，我分成了四個 View，分別是</p><ul><li>CotentView：主程式，結合所有 View 後顯示畫面</li><li>introView：包含 bird paradise 的文字介紹與圖片，裡面也有包含園區的地圖</li><li>transIntro：交通資訊的內容</li><li>parkIntro：各個園區介紹</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*DFcVyf9uIzvvf6l8OQwaHQ.png" /></figure><p>而主要最常用的 property 為 parkView，因為在此作業中我總共介紹了 bird paradise 內的六個園區，所以非常適合使用 property，在這個 property 內，我只需要傳入園區名稱、介紹內容以及圖片，就可以有相同格式的園區介紹出現。</p><p>程式：</p><pre>struct parkView: View{<br>    let title: String<br>    let content: String<br>    let imageNames: [String]<br>    <br>    var body: some View{<br>        ScrollView{<br>            VStack(spacing: 10){<br>                Text(title)<br>                    .font(.title2)<br>                    .bold()<br>                <br>                Text(content)<br>                    .font(.body)<br>                    .padding()<br>                <br>                ScrollView(.horizontal) {<br>                    LazyHStack(spacing: 12) {<br>                        ForEach(imageNames, id: \.self) { imageName in<br>                            Image(imageName)<br>                                .resizable()<br>                                .scaledToFill()<br>                                .frame(width: 160, height: 110)<br>                                .clipShape(<br>                                    RoundedRectangle(cornerRadius: 12)<br>                                )<br>                        }<br>                    }<br>                }<br>            }<br>            .clipShape(.rect(cornerRadius: 10))<br>            .padding(16)<br>            // Material 會根據 Light / Dark Mode 自動調整明暗與文字對比<br>            .background(<br>                .regularMaterial,<br>                in: RoundedRectangle(<br>                    cornerRadius: 28,<br>                    style: .continuous<br>                )<br>            )<br>            // 卡片和螢幕邊緣的距離<br>            .padding(.horizontal, 16)<br>        }<br><br>    }<br>}</pre><p>如何使用：</p><pre>parkView(<br>    title: &quot;Winged Sanctuary飛禽保護區&quot;,<br>    content: &quot;全區唯一使用大型網架、分別將瀕危保育特有大型鳥禽入住的保護區，有來自印度雙角犀鳥、和菲律賓國鳥食猿鵰……等。&quot;,<br>    imageNames: [<br>        &quot;p1_1&quot;,<br>        &quot;p1_2&quot;,<br>        &quot;p1_3&quot;<br>    ]<br>)</pre><h4>四、成果展示</h4><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2Fzt_O2xESAlM&amp;type=text%2Fhtml&amp;schema=youtube&amp;display_name=YouTube&amp;src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fzt_O2xESAlM%3Ffeature%3Doembed" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2177f70610151e8b321d7094f0d57979/href">https://medium.com/media/2177f70610151e8b321d7094f0d57979/href</a></iframe><h4>五、心得</h4><p>相較於前兩次的作業，這次感覺又更了解一個 App 是怎麼被開發的，包括應該要分成多個 View 以及用 property 來讓自己的主程式更簡潔，同時也確保在過程中維持一致。</p><p>我覺得主要練習的 function (HStack, VStack, ScrollView）都沒有很難，不過要用 modifier 改到自己想要的風格還蠻折磨人的，而且也有很多功能可以做使用和搭配，如何設計一個賞心悅目的 UI 對我來說是一個很大的考驗。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb2237e281d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88/03-about-%E9%A0%81%E9%9D%A2-%E6%96%B0%E5%8A%A0%E5%9D%A1%E9%A3%9B%E7%A6%BD%E5%85%AC%E5%9C%92%E4%BB%8B%E7%B4%B9-fb2237e281d0">#03 About 頁面：新加坡飛禽公園介紹</a> was originally published in <a href="https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88">台大 iOS App 程式設計</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#2 用形狀創作圖案]]></title>
            <link>https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88/2-%E7%94%A8%E5%BD%A2%E7%8B%80%E5%89%B5%E4%BD%9C%E5%9C%96%E6%A1%88-2f39d248a512?source=rss-0ea3e4efa498------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f39d248a512</guid>
            <dc:creator><![CDATA[Hohsin]]></dc:creator>
            <pubDate>Fri, 02 Oct 2026 15:29:35 GMT</pubDate>
            <atom:updated>2026-10-02T15:29:35.334Z</atom:updated>
            <content:encoded><![CDATA[<p>Mobile Application Designing Homework 2<br>Github 連結：<a href="https://github.com/hsin1023/MD_QUOKKA.git">https://github.com/hsin1023/MD_QUOKKA.git</a></p><h3>角色選擇</h3><p>我在這次作業所選擇的圖案是 QUOKKA（短尾矮袋鼠）的貼圖，之前看到覺得很可愛，想說雖然有點難度但是應該花點時間就能做出來，因此就選擇其中一個貼圖來製作。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*JOr2MjA6g5Mot89BZ2O4Ng.png" /><figcaption>原貼圖樣子</figcaption></figure><h4>製作成果：</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H43WYl6kBjPCsRsQpyDMNA.png" /></figure><h4>使用 function 和 struct</h4><ol><li>我使用了老師簡報內的 Rectangle, UnevenRoundedRectangle, RoundedRectangle, Circle, Ellipse，基本上身體、手、腳以及一些需要補色的地方都是用以上 function 完成的。</li><li>為了做出箱子上類似平行四邊形的東西，我請 GPT 幫我生成 SwiftUI 的 path，我的理解大致上是用座標標出許多點，並且說明點與點之間的連線方法（例如直線、各種曲線等），最後在裡面填色得到自己想要的圖塊形狀。<br>這部分稍微花了點時間，原因是一開始生成的通常會和想像中有細微的差別，不過因為我的形狀幾乎都是平行四邊形（只是方向不同），比較有差的地方大概也只有圓角的部分，所以稍微手動調整就可以做出我想要的效果。</li></ol><h4>製作過程</h4><ol><li>因為我對我本人的美感相當有自信，知道沒有點參照物一定會做壞，所以我先把目標圖放在畫面中間，並且調低透明度，讓我有一個參照物可以慢慢調整形狀與大小。</li><li>開始之前，我用平板稍微畫了一下每一個部分應該要用什麼形狀，一開始我是連同上面箱子還有 QUOKKA 臉部的陰影都有考慮進去，不過後面遇到了一些問題，待會會說到。</li><li>在正式開始之前，我也先在 Asset 準備好待會應該會用到的顏色（包含背景），並將它們設成能快速理解用途的名字，替後面節省不少時間。</li><li>我判斷下半身相對簡單，因此決定從下半身開始做，可以看到原本的圖片下半身其實有很多小曲線，因為是用比較規律的形狀去組裝，所以不太能組出那種曲線自然的感覺，自己覺得有點可惜。</li><li>到臉部的時候（就把和箱子平行的部分當作臉部吧！）就稍微有點難了，因為形狀更不固定，這時我就利用了 ZStack 內先後順序的特性。例如臉部右上方他是往右下斜的，但我們沒有形狀可以同時把整張臉用出同樣的顏色且滿足該形狀，所以我就將 Rectangle 延伸到箱子的地方，最後再用箱子可以蓋住延伸出去的部分來快速達到我要的效果。<br>基本上箱子組裝的時候我也運用到很多次相同的概念！</li><li>最後就是最難的部分了，箱子因為有很多類似平行四邊形，但又有點圓弧的形狀，一開始嘗試用 UnevenRoundedRectangle 去做，但一直做不出自然的感覺，因此求助 AI 得到了剛剛提到的 path 方法，除了箱子左邊那一片，剩下的部分基本上都是靠這個方法完成的。</li></ol><h4>動畫製作</h4><p>完成之後想說用 AI 讓我的角色動一下，一開始想像的畫面是：「箱子蓋著 QUOKKA 的頭，QUOKKA 用手把它往上拉」，但因為 ZStack 疊層順序的關係，下了這個 prompt 我的 QUOKKA 直接變形，所以就換了一個比較簡單的讓他走動的 prompt，並且提醒他千萬別動我的圖層順序啊，於是得到了這個小動畫</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0AQhobjtWIs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2F0AQhobjtWIs%3Ffeature%3Dshare&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0AQhobjtWIs%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d90c2dbd83e2b70953a76a9d2e7db8b3/href">https://medium.com/media/d90c2dbd83e2b70953a76a9d2e7db8b3/href</a></iframe><h4>學習心得</h4><p>這次最大的收穫是 ZStack 先後順序的重要性，透過這個特性可以簡化一些原本需要額外花時間寫 path 的圖形推疊，不過也需要注意若是以後要讓圖片動起來，就更需要確認先後順序是正確的，否則就會出現一開始形狀亂跑的情況發生。</p><p>除此之外，也發現在設計圖形的時候註解非常重要，有時候去調整其他地方回來之後，如果沒看到註解就很難知道某段程式代表的是哪一個圖形。</p><p>這個作業也讓我練習使用了很多形狀的 function 以及其 modifier，雖然要做出自己預期中的形狀還是很難，但是慢慢調整的過程學到了非常多！</p><h4>程式碼</h4><p>這部分有點多，主要附上 Content View 的內容，其他更詳細的可以到 Github 看&gt;&lt;</p><pre>struct ContentView: View {<br>    var body: some View {<br>        ZStack {<br>            Color.wisteria<br>                .ignoresSafeArea()<br><br>            PhaseAnimator([false, true]) { isStepForward in<br>                ZStack {<br>                    //左腳<br>                    UnevenRoundedRectangle(topLeadingRadius: 6, bottomLeadingRadius: 6, bottomTrailingRadius: 5, topTrailingRadius: 50, style: .continuous)<br>                        .frame(width: 80, height: 15)<br>                        .offset(<br>                            x: isStepForward ? -35 : -25,<br>                            y: isStepForward ? 170 : 174<br>                        )<br>                        .rotationEffect(.degrees(isStepForward ? 8 : 2))<br>                    //右腳<br>                    UnevenRoundedRectangle(topLeadingRadius: 50, bottomLeadingRadius: 7, bottomTrailingRadius: 8, topTrailingRadius: 6)<br>                        .frame(width: 75, height: 15)<br>                        .offset(<br>                            x: isStepForward ? 50 : 60,<br>                            y: isStepForward ? 179 : 175<br>                        )<br>                        .rotationEffect(.degrees(isStepForward ? -2 : -8))<br>            <br>            //右下箱子<br>            RoundedRectangle(cornerRadius: 4)<br>                .foregroundStyle(.hatBrown)<br>                .frame(width: 20, height: 35)<br>                .offset(x:94, y:75)<br>                .rotationEffect(.degrees(-15))<br>            <br>            RoundedRectangle(cornerRadius: 4)<br>                .foregroundStyle(.hatShadow)<br>                .frame(width: 20, height: 40)<br>                .offset(x:90, y:75)<br>                .rotationEffect(.degrees(-15))<br>                <br>            <br>            //身體<br>            UnevenRoundedRectangle(topLeadingRadius: 20, bottomLeadingRadius: 30, bottomTrailingRadius: 40, topTrailingRadius: 30)<br>                .frame(width: 200, height: 100)<br>                .foregroundStyle(.quokkaBrown)<br>                .offset(x:20, y:100)<br>            Ellipse().frame(width: 200, height: 100)<br>                .foregroundStyle(.quokkaBrown)<br>                .offset(x:20, y:125)<br>            <br>            //左箱子<br>            RoundedRectangle(cornerRadius: 15)<br>                 .foregroundStyle(.hatBrown)<br>                 .frame(width: 65, height: 110)<br>                 .rotationEffect(.degrees(-28))<br>                 .offset(x:-125, y:-9)<br>            RoundedRectangle(cornerRadius: 8)<br>                 .foregroundStyle(.hatShadow)<br>                 .frame(width: 65, height: 110)<br>                 .rotationEffect(.degrees(-28))<br>                 .offset(x:-122, y:-5)<br>            <br>            //右上方箱子<br>            RoundedParallelogram()<br>                .fill(.hatShadow)<br>                .frame(width: 100, height: 60)<br>                .offset(x:-96, y:-120)<br>                .rotationEffect(.degrees(70))<br>            RoundedRectangle(cornerRadius: 10)<br>                .foregroundStyle(.hatShadow)<br>                .frame(width:85, height:55)<br>                .offset(x:-55, y:-120)<br>                .rotationEffect(.degrees(70))<br>            Rectangle()<br>                .foregroundStyle(.hatShadow)<br>                .frame(width: 40, height: 100)<br>                .offset(x:55, y:-100)<br>            //最上方箱子<br>            TopBottomShape()<br>                .fill(.hatBrown)<br>                .frame(width: 235, height: 100)<br>                .offset(x: -10, y:-145)<br>            <br>            //臉<br>            RoundedRectangle(cornerRadius: 10)<br>                .frame(width: 190, height: 25)<br>                .foregroundStyle(.quokkaBrown)<br>                .offset(x:14, y:50)<br>            MiddleBodyShape().frame(width: 220, height: 150)<br>                .foregroundStyle(.quokkaBrown)<br>                .offset(x:20)<br>            MiddleBodyShape().frame(width: 100, height: 60)<br>                .foregroundStyle(.quokkaBrown)<br>                .rotationEffect(.degrees(90))<br>                .offset(x:-60, y:-20)<br>            <br>            //上方箱子圓形部分<br>            Circle().frame(width:31)<br>                .foregroundStyle(.quokkaBrown)<br>                .offset(x:-18, y:-132)<br>            Circle().frame(width:30)<br>                .foregroundStyle(.hatCircle)<br>                .offset(x:-18, y:-127)<br>            <br>            Circle().frame(width:31)<br>                .foregroundStyle(.quokkaBrown)<br>                .offset(x:-55, y:-132)<br>            Circle().frame(width:30)<br>                .foregroundStyle(.hatCircle)<br>                .offset(x:-55, y:-127)<br><br>            <br>            //上方箱子<br>            RoundedParallelogram()<br>                .fill(.hatBrown)<br>                .frame(width: 250, height: 80)<br>                .offset(x:-36, y:-86)<br>                .rotationEffect(.degrees(-3))<br>            RoundedParallelogram()<br>                .fill(.hatShadow)<br>                .frame(width: 250, height: 80)<br>                .offset(x:-40, y:-82)<br>                .rotationEffect(.degrees(-3))<br>            <br>            <br>            //臉上的陰影<br>            FaceShadowShape()<br>                .fill(.quokkaShadow)<br>                .frame(width: 180, height: 30)<br>                .offset(x:-3, y:-48)<br>            <br>            //右箱子<br>            BoxShape().fill(.hatBrown)<br>                .frame(width: 110, height: 130)<br>                .offset(x:123, y:2)<br>                .rotationEffect(.degrees(-5))<br>            BoxShape().fill(.hatShadow)<br>                .frame(width: 110, height: 130)<br>                .offset(x:120, y:5)<br>                .rotationEffect(.degrees(-5))<br>            <br>            <br>            //左手<br>            Ellipse().frame(width: 110, height: 40)<br>                .foregroundStyle(.quokkaBrown)<br>                .offset(x:-5, y:85)<br>                .rotationEffect(.degrees(80))<br>            UnevenRoundedRectangle(topLeadingRadius: 5, bottomLeadingRadius: 7, bottomTrailingRadius: 7, topTrailingRadius: 5)<br>                .frame(width: 13, height: 22)<br>                .foregroundStyle(.black)<br>                .offset(x:-87, y:-60)<br>                .rotationEffect(.degrees(-7))<br>            UnevenRoundedRectangle(topLeadingRadius: 5, bottomLeadingRadius: 7, bottomTrailingRadius: 10, topTrailingRadius: 5)<br>                .frame(width: 15, height: 15)<br>                .foregroundStyle(.black)<br>                .offset(x:-95, y:-58)<br>                .rotationEffect(.degrees(-7))<br>            UnevenRoundedRectangle(topLeadingRadius: 5, bottomLeadingRadius: 7, bottomTrailingRadius: 6, topTrailingRadius: 5)<br>                .frame(width: 10, height: 15)<br>                .foregroundStyle(.black)<br>                .offset(x:-78, y:-58)<br>                .rotationEffect(.degrees(-7))<br>            //右手<br>            Ellipse().frame(width: 110, height: 40)<br>                .foregroundStyle(.quokkaBrown)<br>                .offset(x:12, y:-50)<br>                .rotationEffect(.degrees(80))<br>            UnevenRoundedRectangle(topLeadingRadius: 4, bottomLeadingRadius: 7, bottomTrailingRadius: 7, topTrailingRadius: 4)<br>                .frame(width: 14, height: 22)<br>                .foregroundStyle(.black)<br>                .offset(x:43, y:-53)<br>            UnevenRoundedRectangle(topLeadingRadius: 5, bottomLeadingRadius: 7, bottomTrailingRadius: 10, topTrailingRadius: 5)<br>                .frame(width: 15, height: 15)<br>                .foregroundStyle(.black)<br>                .offset(x:3, y:-63)<br>                .rotationEffect(.degrees(32))<br>            UnevenRoundedRectangle(topLeadingRadius: 5, bottomLeadingRadius: 10, bottomTrailingRadius: 6, topTrailingRadius: 10)<br>                .frame(width: 12, height: 18)<br>                .foregroundStyle(.black)<br>                .offset(x:62, y:-37)<br>                .rotationEffect(.degrees(-15))<br><br>            //左眼<br>            Circle()<br>                .frame(width:13).offset(x:-34, y:-42)<br>            //右眼<br>            Circle()<br>                .frame(width:13).offset(x:-3, y:-43)<br>            //鼻子<br>            Ellipse().frame(width: 35, height: 42)<br>                .offset(x:-24, y:-6)<br>            //左陰影<br>            InnerShadowShape()<br>                .fill(.quokkaShadow)<br>                .frame(width: 120, height: 110)<br>                .offset(x:-80)<br>            //右陰影<br>                    InnerShadowShape()<br>                        .fill(.quokkaShadow)<br>                        .frame(width: 130, height: 100)<br>                        .offset(x:-38, y:8)<br>                        .rotationEffect(.degrees(187))<br>                }<br>                .offset(y: isStepForward ? -2 : 1)<br>                .rotationEffect(<br>                    .degrees(isStepForward ? 0.4 : -0.4),<br>                    anchor: .bottom<br>                )<br>            } animation: { _ in<br>                .easeInOut(duration: 0.28)<br>            }<br>        }<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f39d248a512" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88/2-%E7%94%A8%E5%BD%A2%E7%8B%80%E5%89%B5%E4%BD%9C%E5%9C%96%E6%A1%88-2f39d248a512">#2 用形狀創作圖案</a> was originally published in <a href="https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88">台大 iOS App 程式設計</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[使用 AI 創作人生第一個 App]]></title>
            <link>https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88/%E4%BD%BF%E7%94%A8-ai-%E5%89%B5%E4%BD%9C%E4%BA%BA%E7%94%9F%E7%AC%AC%E4%B8%80%E5%80%8B-app-6a0d6eee7534?source=rss-0ea3e4efa498------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a0d6eee7534</guid>
            <dc:creator><![CDATA[Hohsin]]></dc:creator>
            <pubDate>Thu, 24 Sep 2026 02:07:56 GMT</pubDate>
            <atom:updated>2026-09-24T02:07:56.227Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ot6OR7fdayG2VUjn3g_irQ.jpeg" /></figure><p>App 名稱：Wall game<br>App 展示影片：<a href="https://youtube.com/shorts/v-f-7eb_HAM">https://youtube.com/shorts/v-f-7eb_HAM</a><br>Github 連結：<a href="https://github.com/hsin1023/Wall_game.git">https://github.com/hsin1023/Wall_game.gi</a>t<br> — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <br>Wall game 是一個雙人策略棋盤遊戲，玩家輪流移動棋子或放置牆壁，在阻擋對手的同時，設法讓自己的棋子率先抵達對方領地，有興趣的可以查查看 wallz.gg，個人覺得偶爾和朋友玩還蠻好玩的，想說就看看能不能做出一樣的東西。</p><p>規則還蠻簡單的，到自己的回合有兩個行動選擇：<br>（一）移動：可以移動至自己棋子相鄰一格，當對方棋子在我方棋子旁邊時，就可以跳過對方棋子多走一格，目標就是將自己的棋子移動到對方的領地。<br>（二）置牆：可以放置一個橫的或是直的牆壁以此阻止對方（或是幫助自己）前進，不過放置牆壁時，必須保證雙方棋子皆至少有一條路線可以抵達對方領地。<br>（當然算上投降這個選項有三個選擇）</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4><strong>一、開發流程（使用 codex 開發）</strong></h4><p>起初為了省 token，我想說先用 Gemini 生出一個 plan 之後再丟給 codex，不過看完他生出的東西感覺跟我直接丟 prompt 給 codex 差不多，所以基本上就算跳過了 plan 的環節直接開始做，大抵上在開發的時候可以分成兩個步驟：</p><ol><li>遊戲內容與風格<br>在最一開始，我先將遊戲的規則以列點式的方式給 codex，並且大致簡單的將棋盤的格式還有顏色等告訴他，因為遊戲的規則算是簡單明瞭，所以基本上遊戲本身是沒什麼大問題的，後續幾次就是在微調 UI，根據去年修網路服務程式設計 Web Programming 與 AI 合作寫網頁的經驗，我認爲用列點式的方式下 prompt 在設計 app 和 web 的時候還蠻有用的，所以每次檢查時我都會列出幾個點請他幫忙修改。總之蠻大一部分就是慢慢微調到我希望他的風格，還有加一些比較細微的功能，如此段下面。</li><li>首頁與音效<br>接下來就是設計遊戲的首頁還有處理 app icon 跟一些音效，基本上下 prompt 的格式和上面一樣，多了找圖還有跟找音樂並且拖進去的過程，還有需要想像一個遊戲從打開 app 到進入遊戲的時候應該會有哪些流程，最一開始有想過要有一個 play with computer 的模式，不過這遊戲雖然不像西洋棋或圍棋這麼複雜，但不用 AI 要寫 script 丟進去應該也是一個蠻困難的問題，這個想法就先擱置了。</li></ol><blockquote>1. 讓紅色方下面也有一個回上一步，然後紅藍方旁邊加一個投降，按了之後點再確認就代表對方勝利。 <br>2. 移動時加一個動畫，就是球球移動到該格的過程。<br>3. 藍色的球稍微再淺一點，然後旁邊球旁邊都不要有白色的圓筐，換到該玩家回合時再出現白色的圓匡就好<br>(prompt 的範例）</blockquote><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4><strong>二、遊戲介面與遊玩過程</strong></h4><p><strong>1. </strong>loading：在打開的時候感覺需要一個 loading 畫面，不然空白在那乾等感覺怪怪的</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2k-8ZiyJN5MNIUDx16Yevw.png" /></figure><p>2. 選擇先手：之前和朋友玩的時候覺得後手好像比較容易贏，所以有跑過 script 去看到底這個是不是一個完全公平的遊戲，印象中應該也確實後手比較容易贏，所以想說可以讓大家開始遊戲時選一下誰先手（不過轉個手機其實也就可以了）。<br>然後標題 Wall game 想說想要有一點科技感，就去找了特殊字體。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KfFyWL3Sn4jw5h2uxSTKdw.png" /></figure><p>3. 遊戲本身<br>3.1 初始狀態</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zVpREix_NOGYod-KK6EGVA.png" /></figure><p>3.2 遊戲中期</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9-5P4wgq3Gf3E8jk17YGyg.png" /></figure><p>3.3 投降畫面<br>在這裡附上一張對想投降者的威壓 “Sorry. You’re NOT a Sigma”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zkmCgOf2BHJxTXmllL2NIw.png" /></figure><p>3.4 勝利畫面：最後就會以勝利的一方有動畫以該顏色填滿棋盤。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ju-lPLoVnLnud1C_TvT3Hg.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>三、App 名稱、Icon、圖片、字體與音效</h4><p><strong>App 名稱與 Icon：</strong>名稱就叫 Wall game，然後 icon 請 gemini 生的。</p><blockquote>幫我生成一個 1024 x 1024 px 的圖片，中間有 Wall game 標題（字體同照片），以淺紅、淺藍在對角渲染，並以黑色為底。</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YmSBMZG7bSiaZjQZpVGv9g.png" /></figure><p><strong>圖片：</strong>我在這裡有使用的圖片只有投降時顯示的圖片，主要原因是找不太到合理的原因跟合適的圖片放在這個遊戲裡面。</p><p><strong>字體：</strong>看老師教怎麼換特殊字體的時候剛好覺得範本蠻適合當標題 Wall game 的字體，所以就照著老師教的方法改了 Wall game 的字體。</p><p><strong>音效：</strong>試玩感覺的時候感覺沒有點音效好像玩不太下去，所以就加了幾個音效，例如移動時的聲音跟勝利時的聲音，還有主頁想說也放個音樂，來源都是從 Freesound 這個網站找到的。</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>四、有趣的程式(?)</h4><p>我自己覺得比較有趣的大概是這個 hasPath 吧，痾雖然說是有趣但實際上就是簡單的 BFS，不過我個人算很少在資料結構或演算法看到他出現，覺得還蠻新奇的。<br>但是仔細想想，其實在找路線或是地圖等相關的應用，遇到什麼 BFS、DFS 或是 A* 應該都蠻正常的？不過實作這種東西交給 AI 還是快多了非常舒服。</p><pre>private func hasPath(for player: Player, walls: Set&lt;Wall&gt;) -&gt; Bool {<br>    // 使用廣度優先搜尋，確認玩家能否抵達任一目標列格子。<br>    var queue = [position(of: player)]<br>    var nextIndex = 0<br>    var visited: Set&lt;BoardPosition&gt; = [position(of: player)]<br><br>    while nextIndex &lt; queue.count {<br>        let position = queue[nextIndex]<br>        nextIndex += 1<br>        if position.row == player.goalRow { return true }<br><br>        for direction in Self.directions {<br>            let next = position.moved(row: direction.0, column: direction.1)<br>            if isInside(next), !visited.contains(next),<br>               !isBlocked(from: position, to: next, walls: walls) {<br>                visited.insert(next)<br>                queue.append(next)<br>            }<br>        }<br>    }<br>    return false<br>}</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h4>五、心得與發想</h4><p>得益於上學年修過網服並且和 AI 一起寫 app 某種程度上跟寫 web 還蠻像的，重點是 AI 在這一年又變強很多啦（不過我自己做的東西也算是簡單），所以在開發的過程中比較不像以前有卡關比較久的問題。</p><p>不過在過程中也覺得有些真的很微調的東西自己手動調還是快很多，因為自己沒怎麼接觸過 swift，所以連在寫網頁上簡單的事都需要靠 agent 來完成，除了怎麼下一個好的 prompt 以外，能看懂程式還是一件很重要的事，當然更重要的還是有趣的想法吧，畢竟實作的難度大大減少了，好的想法才是一個 app 吸引人的關鍵。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a0d6eee7534" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88/%E4%BD%BF%E7%94%A8-ai-%E5%89%B5%E4%BD%9C%E4%BA%BA%E7%94%9F%E7%AC%AC%E4%B8%80%E5%80%8B-app-6a0d6eee7534">使用 AI 創作人生第一個 App</a> was originally published in <a href="https://medium.com/%E5%8F%B0%E5%A4%A7-cs-x-ios-app-%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88">台大 iOS App 程式設計</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>