<?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 Jason on Medium]]></title>
        <description><![CDATA[Stories by Jason on Medium]]></description>
        <link>https://medium.com/@jason_0619?source=rss-b87fbf9cc783------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sai-Bfr_oKKkgCHp9prXYg.jpeg</url>
            <title>Stories by Jason on Medium</title>
            <link>https://medium.com/@jason_0619?source=rss-b87fbf9cc783------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 16:03:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jason_0619/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[個人筆記(2025/5)]]></title>
            <link>https://medium.com/@jason_0619/%E5%80%8B%E4%BA%BA%E7%AD%86%E8%A8%98-2025-5-1b4effd620bd?source=rss-b87fbf9cc783------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b4effd620bd</guid>
            <dc:creator><![CDATA[Jason]]></dc:creator>
            <pubDate>Tue, 27 May 2025 02:44:54 GMT</pubDate>
            <atom:updated>2025-05-27T03:26:34.847Z</atom:updated>
            <content:encoded><![CDATA[<p>📘 Swift 型別比較表：enum vs struct vs class</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*48I--6kYI4QbuBloJgRX0g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*47cE2mfNXqaNHDP0zr888Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*_VXiRUMJq1UKOcfhan9aUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*GwA2rVfJgCsiglMd7w5Onw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*OBPbFzAL8HgneDA6NpqckA.png" /></figure><p>✚ 什麼可以放在enum裡面？</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*T1pajfVwOL2vG6J4xXfyGg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*ZAdllVJTPD0WhL-LKHwlmQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*wTkevAQov4mPHsohqbI0sQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*amqbRhnvLu478s9_RDeOAQ.png" /></figure><p>✚你宣告了一個變數 dir，型別是 enum Direction，並賦值為其中一個 case .left。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*8TmVOxY9mTsrWdVLsl8vUw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b4effd620bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[個人筆記]]></title>
            <link>https://medium.com/@jason_0619/%E5%80%8B%E4%BA%BA%E7%AD%86%E8%A8%98-725bb0425414?source=rss-b87fbf9cc783------2</link>
            <guid isPermaLink="false">https://medium.com/p/725bb0425414</guid>
            <dc:creator><![CDATA[Jason]]></dc:creator>
            <pubDate>Wed, 26 Feb 2025 01:39:53 GMT</pubDate>
            <atom:updated>2025-03-12T06:49:24.826Z</atom:updated>
            <content:encoded><![CDATA[<p>☁如果有IBOutlet，你寫跳頁要寫UIStoryboard</p><p>☁沒有拉IBOutlet的你就可以直接這樣let connieView = AIConnieMainTableViewController()</p><pre>let homeView = UIStoryboard(name: HardcodedString.shared.strMain, bundle: nil).instantiateViewController(withIdentifier: HardcodedString.shared.strHomeViewController)<br>let connieView = AIConnieMainTableViewController(checkPlay: 0)<br>guard let navigationController = self?.navigationController else { return }<br>connieView.navigationItem.backButtonTitle = &quot;&quot;<br><br>homeView.navigationItem.backBarButtonItem = UIBarButtonItem(title: &quot;&quot;, style: .plain, target: nil, action: nil)<br>navigationController.setViewControllers( [homeView, connieView], animated: true)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ixiuTsy5_3UrM-LZE097FQ.png" /></figure><h4>☁你的Home的navigationBar，回上一頁如果不想要有Back鍵，要寫在跳頁的地方homeView.navigationItem.backBarButtonItem = UIBarButtonItem(title: “”, style: .plain, target: nil, action: nil)</h4><p>☁因為雖然你已經設定好</p><p>let homeView = UIStoryboard(name: HardcodedString.shared.strMain, bundle: nil).instantiateViewController(withIdentifier: HardcodedString.shared.strHomeViewController)</p><p>但這只是init，你還沒load，所以要在設定跳轉這頁的地方寫好！</p><pre>let homeView = UIStoryboard(name: HardcodedString.shared.strMain, bundle: nil).instantiateViewController(withIdentifier: HardcodedString.shared.strHomeViewController)<br>let connieView = AIConnieMainTableViewController(checkPlay: 0)<br>guard let navigationController = self?.navigationController else { return }<br>connieView.navigationItem.backButtonTitle = &quot;&quot;<br><br>homeView.navigationItem.backBarButtonItem = UIBarButtonItem(title: &quot;&quot;, style: .plain, target: nil, action: nil)<br>navigationController.setViewControllers( [homeView, connieView], animated: true)</pre><p>☁看到『contentVC.delegate = self』就要有感覺，你是要把自己這個class丟到（指向）contentVC的delegate。</p><p>☁contentVC執行 『delegate.點什麼的時候就會呼叫執行你這個class的func』</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*02ASzRmWUNTx01trRWV6VA.png" /></figure><h3>☁單例模式，重開APP就洗掉</h3><h3>☁UserDefaults.standard.set(false, forKey: “isOnBordingDone”) 要移除APP值才會不見</h3><p>☁上版的時候要注意，你上testFlight是要release還是debug</p><p>#if DEBUG</p><p>let cloud_api_server = “https://mwr.simpnic.com:19630&quot;</p><p>#else</p><p>let cloud_api_server = “https://mwr.simpnic.com:19630&quot;</p><p>#endif</p><p>☁你這頁的Back鍵是上一頁決定的，因為是回到上一頁</p><p>☁viewDidAppear是已經出現。</p><p>☁viewWillAppear是將要出現，你往旁邊輕輕拉1/5頁面就會觸發</p><pre>override func viewDidAppear(_ animated: Bool) {<br>        super.viewDidAppear(animated)<br>    }<br><br>override func viewWillAppear(_ animated: Bool) {<br>        super.viewWillAppear(animated)<br>    }</pre><p>☁你要看頁面上面navigationBar是不是自己做的還是原生的，拉剖面圖看他名字原生的名字跟自己做的應該很容易看出來差異。</p><h3>☁<strong>強制解包非常危險！</strong></h3><h3>☁<strong>千萬不要用『！』要用if let</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gibmJwd3EZdHHDX11wCpuQ.png" /></figure><p>☁Global全域</p><h4>第一次存取 Global 內的變數或方法時</h4><p>因為 Global 內的所有屬性都是 static，它們的記憶體會在 <strong>第一次存取時</strong> 被分配</p><p>如果 <strong>沒有存取 </strong><strong>Global 內的變數或方法，它的靜態變數就不會初始化，也不會執行 </strong><strong>Global 類別的任何東西</strong>。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*H4lBWzASsQAQD1HFWNgTPQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F8xaVV0R33JHd3xLBVST2g.png" /></figure><h3>☁TableView要非常小心超過範圍，會crashed</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*hpHoiy8UULPoc554bqcniw.png" /></figure><h4>☁cellForRowAt 也要注意要寫</h4><p>guard indexPath.section &lt; connieConversationListArrayForList.count else</p><p>{</p><p>print(“Error: section \(indexPath.section) 超出範圍”)</p><p>return UITableViewCell() // 返回空白的 Cell，避免<strong>崩潰</strong></p><p>}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ArxrA4691femod-A7oHhQQ.png" /></figure><h3>☁有用到indexPath的都要特別寫小心超出範圍</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*73XzWr3DTgxR0nooAHOlzQ.png" /></figure><p>☁按鈕圖片去特別設成.alwaysOrignal =&gt; 這樣才能顯示圖案原本的顏色</p><p>因為預設是.alwaysTemplate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ACGPhL8xkHXR3cAJ9vCbqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*AfeRIejZTsb8AOpj0ApRqQ.png" /></figure><p>☁點鍵盤鍵盤彈起來，調整tableView讓內容不會被遮到</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r2WSlwrRNhTn_alzNwZyIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZmMo7s_gc2QkVCEn9Vetqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b4j3j7kzX0nFiYop-fEktA.png" /></figure><pre>class ViewController: UIViewController {<br><br>    @IBOutlet weak var tableView: UITableView!<br>    var originalTableViewHeight: CGFloat = 0<br><br>    override func viewDidLoad() {<br>        super.viewDidLoad()<br>        <br>        // 記住原始 TableView 高度<br>        originalTableViewHeight = tableView.frame.height<br><br>        // 註冊鍵盤通知<br>        NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)<br>        NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)<br>    }<br><br>    @objc func keyboardWillShow(_ notification: Notification) {<br>        guard let userInfo = notification.userInfo,<br>              let keyboardFrame = userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect else { return }<br><br>        let keyboardHeight = keyboardFrame.height<br>        let visibleHeight = self.view.bounds.height - keyboardHeight<br><br>        UIView.animate(withDuration: 0.3) {<br>            self.tableView.frame.size.height = visibleHeight<br>        }<br><br>        // 🔥 鍵盤彈出後，滑到底部<br>        tableView.scrollToBottom()<br>    }<br><br>    @objc func keyboardWillHide(_ notification: Notification) {<br>        // 鍵盤收回時，恢復原始 TableView 高度<br>        UIView.animate(withDuration: 0.3) {<br>            self.tableView.frame.size.height = self.originalTableViewHeight<br>        }<br>    }<br>}</pre><p>☁contentOffset跟scrollToRow差異</p><pre>import UIKit<br>extension UITableView {<br>    func scrollToBottom(animated: Bool = true) {<br>            DispatchQueue.main.async { [weak self] in<br>                guard let self = self else { return }<br>                <br>                let lastSection = max(0, self.numberOfSections - 1)<br>                let lastRow = max(0, self.numberOfRows(inSection: lastSection) - 1)<br><br>                // 🔥 確保有有效的 Section 和 Row<br>                if lastSection &gt;= 0, lastRow &gt;= 0 {<br>                    let indexPath = IndexPath(row: lastRow, section: lastSection)<br>                    self.scrollToRow(at: indexPath, at: .bottom, animated: animated)<br>                }<br>            }<br>        }<br>}<br><br>func scrollToBottom(animated: Bool = true) {<br>    let contentOffest = max(0, self.contentSize.height - self.bounds.height)<br>    self.setContentOffset(CGPoint(x: 0, y: contentOffest), animated: animated)<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EJa5yVCQL43wqDOlX2niLQ.png" /></figure><p>☁找到最後一個section，然後最後一個section的最後一個row</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uLgmLN0H_iSWu8hBfmT3pQ.png" /></figure><pre>let lastSection = max(0, self.numberOfSections - 1)<br>let lastRow = max(0, self.numberOfRows(inSection: lastSection)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IXqmtQgLfupBBF7l6Hk_fg.png" /></figure><p>☁鍵盤要他顯示跟隱藏的時候做事情，要寫監聽keyboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hH8yNhMkgZjtb3kYbwj_bg.png" /></figure><p>☁鍵盤顯示和隱藏時，要記錄tableview的高度，要自己去手動調整他。</p><p>☁跟你conversationList滑到哪裡，點進去那則，出來也要conversationList也要在同位置，要自己去紀錄一樣。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f97BT7FPDTUWN2gYXycGCQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=725bb0425414" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[elio教學]]></title>
            <link>https://medium.com/@jason_0619/elio%E6%95%99%E5%AD%B8-02f22c9600c7?source=rss-b87fbf9cc783------2</link>
            <guid isPermaLink="false">https://medium.com/p/02f22c9600c7</guid>
            <dc:creator><![CDATA[Jason]]></dc:creator>
            <pubDate>Tue, 14 Jan 2025 16:50:59 GMT</pubDate>
            <atom:updated>2025-03-10T17:06:04.437Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>tableview預設會避開navigation bar(會從他下面滑穿過)</li><li>所以有navigation bar的時候, 要對齊safeArea(不能對齊view)</li><li>『主執行緒一次只能做一件事：所以UI相關的要放進去』</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZR7b2PIW1iVPSDm_FlEaBg.jpeg" /></figure><ul><li>delegate：要放一個protocol?</li><li>vc要遵從protocol（你遵從就會要你實作protocol的func）</li><li>然後你vc要把自己丟進去delegate（就是把delegate指向自己）</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bVKL18Nq50abSBmmt0leFQ.jpeg" /></figure><pre>// MARK: - UIScrollViewDelegate<br>    func scrollViewDidScroll(_ scrollView: UIScrollView) {<br>        let offsetY = scrollView.contentOffset.y （使用者滑動距離）<br>        let contentHeight = scrollView.contentSize.height （tableView內容高度）<br>        let frameHeight = scrollView.frame.size.height（tableView元件高度）<br>        <br>        if offsetY &gt; contentHeight - frameHeight - 100 { // 預載 100px 高度<br>            loadMoreData()<br>        }<br>    }</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=02f22c9600c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[記錄每天學到的技能樹（八月）]]></title>
            <link>https://medium.com/@jason_0619/%E8%A8%98%E9%8C%84%E6%AF%8F%E5%A4%A9%E5%AD%B8%E5%88%B0%E7%9A%84%E6%8A%80%E8%83%BD%E6%A8%B9-%E5%85%AB%E6%9C%88-420b31f7890d?source=rss-b87fbf9cc783------2</link>
            <guid isPermaLink="false">https://medium.com/p/420b31f7890d</guid>
            <dc:creator><![CDATA[Jason]]></dc:creator>
            <pubDate>Thu, 01 Aug 2024 16:48:14 GMT</pubDate>
            <atom:updated>2024-08-17T16:03:56.914Z</atom:updated>
            <content:encoded><![CDATA[<p>8月1日（四）</p><p>⦿sortedData.first(where: {$0.withdrawnAt == nil}) 找到第一筆withdrawnAt等於nil的</p><pre> if let lastData = sortedData.first(where: {$0.withdrawnAt == nil}) {<br>            self.moreHeightCon.constant = 50<br>            notificationLabel.text = lastData.title<br>        } else {<br>            self.moreHeightCon.constant = 0<br>            notificationLabel.text = &quot;&quot;<br>        }</pre><p>⦿你可以在接api回來的這裡下中斷點，然後『po delegate』看是不是指向你現在的那個VC，例如homeViewController</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uF5eKt4CAAijK3IcH8qIDg.png" /></figure><p>８月17日（六）</p><p>⦿ UIProgressView 原生的進度條</p><p>⦿有分VC的生命週期跟APP的生命週期</p><p>◈VC的生命週期就是viewdidLoad那些</p><p>◈APP的生命週期『App Life Cycle』</p><p>◈在可以操作的時候是『Active』&gt; 準備滑掉『Inactive』(這時候會暫停) &gt; 再往後滑就會到『Background』(這時候App還有在跑喔！) &gt; 你放太久就會到『Suspended』(這個時候喚醒他的話，會進到Inactive，再進到active，再給使用者操作)</p><p>◈如果你在『Suspended』放太久的話，連記憶體都被回收掉的話，他就會到 &gt; 『Not Running』，下次再開起的話就會走『Inactive』再到『Active』</p><p>◈『Inactive』這是一個過渡的畫面(App還沒開始之前)，其實是非常快的（初始化階段），但這個階段不能做事情。（就像Netfix跑Netfix這幾個字的時候，就是在Inactive）</p><p>◈『Active』使用者開始使用</p><p>◈『Suspended』不能再跑任何程式碼，但他還活著。</p><p>◈『Background』是可以拉長時間的，就像滑到桌面還是繼續可以播音樂，表示他『Background』有打開來，可以在『BackGround』跑東西。他就不會到『Suspended』。EX: 像是Youtube，表示他都可以到『Background』只是看他到『Background』還要不要讓你播音樂。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fm0_z83QrK_6rImK5sw7Wg.png" /></figure><p>⦿App生命週期做事情會寫在AppDelegate，找func『applicationDidBecomeActive』或『applicationWillEnterForeground』回到前景的時候</p><p>⦿</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=420b31f7890d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[記錄每天學到的技能樹（七月）]]></title>
            <link>https://medium.com/@jason_0619/%E8%A8%98%E9%8C%84%E6%AF%8F%E5%A4%A9%E5%AD%B8%E5%88%B0%E7%9A%84%E6%8A%80%E8%83%BD%E6%A8%B9-d7894465dfd6?source=rss-b87fbf9cc783------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7894465dfd6</guid>
            <dc:creator><![CDATA[Jason]]></dc:creator>
            <pubDate>Sat, 06 Jul 2024 15:29:24 GMT</pubDate>
            <atom:updated>2024-07-31T16:06:53.982Z</atom:updated>
            <content:encoded><![CDATA[<p>7月6日（六）</p><p>繼承UITextFieldDelegate，有兩個內建func可以用</p><ol><li>textFieldDidBeginEdititng 點擊輸入框</li><li>textFieldDidEndEditing 點擊輸入匡以外的地方</li></ol><p>7月7日（日）</p><ol><li>hamburger會用present不會用navigationController.push，因為你是蓋一片在上面。</li><li>然後他會判斷HomeViewController，present出hamburger，homeViewController是不是navigation</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uxc8QWp9bQEWcFz7LAn87A.png" /></figure><p>3. enum可以寫在class裡面，表示只能被這個class使用。他的作用域只在這個class裡面。</p><p>4. 這個didTapAction是一個閉包，會傳一個Event進去就是自定義enum，然後不會回傳任何東西『這裡要想到用這個閉包他既然不會回傳東西，表示就可以把這個class釋放掉，但呼叫他的又可以拿到東西=&gt;表示他是逃逸閉包的型態（逃逸閉包要把東西丟出去，我們是把enum丟出去）』</p><p>5. 這樣你就把hamburger丟一個callbackfunction給HomeViewController，讓他去做presentvc的動作。這樣你就可以在dismis後去call這個閉包。點了hamburger後，他會關掉hamburger再去跳頁。</p><pre>class PopHamburgerViewController: UIViewController {<br>    <br>    enum Event {<br>        case didTapHelpCenter<br>    }<br>    <br>    var didTapAction: ((Event) -&gt; Void)?<br><br>@objc<br>    func helpCenterButtonTouchUpInside(_ sender:UIButton)<br>    {<br>        dismiss(animated: false) {<br>            self.didTapAction?(.didTapHelpCenter)<br>            }</pre><pre>//class HomViewController<br><br>@objc func changeRouterBtnClick() {<br>        let vc = PopHamburgerViewController()<br>        vc.modalPresentationStyle = .overFullScreen<br>        vc.didTapAction = { event in<br>            switch event {<br>            case .didTapHelpCenter:<br>                let vc = HelpForCenterTableViewController()<br>                self.navigationController?.pushViewController(vc, animated: true)<br>            }<br>        }</pre><p>6.平常寫present，其實還可以再加動作但也可以不加（因為他寫nil，表示可寫可不寫）</p><pre>self.present(vc, animated: false)<br>self.present(vc, animated: false){<br>            <br>}<br>//官方<br>open func present(_ viewControllerToPresent: UIViewController, <br>animated flag: Bool, completion: (() -&gt; Void)? = nil)</pre><p>7. 右邊有驚嘆號就表示有問題</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aXvkeU3saJEPr9U4J-v2mQ.png" /></figure><p>8. 要把他設可以autolayout，然後上面設的都沒用，你要去autolayout那裡把圖片設寬度。</p><pre>var ssidErrorImage = {<br>       let imageView = UIImageView()<br>        imageView.translatesAutoresizingMaskIntoConstraints = false<br>        imageView.image = UIImage(named: &quot;ssidErrorImage&quot;)<br>        return imageView<br>    }()<br><br>NSLayoutConstraint.activate([<br>            passwordErrorImage.widthAnchor.constraint(equalToConstant: 15),<br>            ssidErrorImage.widthAnchor.constraint(equalToConstant: 15),</pre><p>7月11日（四）</p><ol><li>tableViewcell 內建就是contentView</li></ol><p>7月12日（六）</p><ol><li>protocal + ＠objc =&gt; 遵從後可寫可不寫</li></ol><p>但重點要注意帶的參數要class不能struct，因為@objc時期還沒有struct你參數帶就會爆炸</p><pre>@objc protocol CloudTLSManagerDelegate {<br>    @objc optional func tlsResponse(command: String, data: Any)<br>    @objc optional func tlsResponseFail(command: String)<br>    @objc optional func tlsResponseTimeout(command: String)<br>    @objc optional func initTLSDone()<br>    @objc optional func homeGetDone()<br>    @objc optional func notificationListGet(data:NotificationListData)</pre><p>class的寫法，要繼承NSObject，以及要寫enum及required init</p><pre>class NotificationListData: NSObject, Decodable {<br>    var elements: [NotificationListElementsData]<br>    var number: Int<br>    var limit: Int<br>    <br>    enum CodingKeys: CodingKey {<br>        case elements<br>        case offset<br>        case limit<br>    }<br>    <br>    required init(from decoder: any Decoder) throws {<br>        let container = try decoder.container(keyedBy: CodingKeys.self)<br>        self.elements = try container.decode([NotificationListElementsData].self, forKey: .elements)<br>        self.number = try container.decode(Int.self, forKey: .offset)<br>        self.limit = try container.decode(Int.self, forKey: .limit)<br>    }<br>}</pre><p>7月17日（三）</p><ol><li>如果figma一開始不是拿最小手機規劃，是拿最大手機下去規劃那尺寸一定會有問題，你這樣拿小螢幕手機對齊的時候一定會超過，所以通常會拿最小手機做figma尺寸規劃，因為這樣你換成大手機可能會有點怪，但至少東西都看得到。</li><li>UIScreen.main.bounds.height 可以拿到我們現在這隻手機螢幕的高度，去除以figma整個畫面高度，再去乘以他上面的空格高度。</li><li>所以手機螢幕的高度，去除以figma整個畫面高度可以存起來。去乘以每個對到view最上面的高度。</li></ol><p>7月21日（日）</p><ol><li>計算屬性</li></ol><pre>var name = {return UserDefaults.cloudUserInfo.string(forKey: .cloud_name) ?? &quot;&quot; }<br>label.text = name() </pre><p>2. 你有去reloadData，cell重新刷新再去讀一次 label.text = name 就會觸發計算屬性，這樣你的name就會變成一個方法</p><p>3. 如果不是cell，你就可以用didSet，去刷新他，但didSet就要用儲存屬性</p><p>這裡要思考一個問題，如果你上一頁去打API改名字，這頁一直沒有更新，你不是去說給他晚個幾秒跳頁或者在另一頁一直reloadData，你這樣是在瞎猜….</p><p>你是要去看哪裡給他賦值的。</p><p>7月22日（一）</p><p>⦿tableView分隔線的樣式 =&gt; supportTableview.separatorStyle = .none</p><ol><li>這樣設就不會每個cell都有一條線在那裡</li><li>沒寫就是default會有一條線在那裡</li></ol><p>⦿你一個東西要有漸層效果，比如說是tableView，然後做的漸層叫做gradientLayerView</p><ol><li>那你tableView要先加到view裡面，再加漸層，這樣你tableView才會有漸層效果</li><li>你tableView的上方Layout要設在漸層正下方，比如說你漸層是對到view.safeTopAnchor，你tableView就要對到view.safeTopAnchor</li><li>你加完漸層到view裡面，再加一個button上去，上方位置都一樣對到view.safeTopAnchor，但這樣你button不會有漸層效果，因為你沒被漸層蓋到</li></ol><pre>view.addSubview(supportTableview)<br>view.addSubview(gradientLayerView)<br>view.addSubview(supportTopButton)</pre><p>4. 漸層的Layout設定，就算tableView左右還有跟view差30間距，你漸層Layout還是可以設跟view沒有間距設全滿。</p><p>5. 然後你漸層的寬度要設定跟view一樣寬，要寫在viewDidLayoutSubviews</p><pre>override func viewDidLayoutSubviews()<br>    {<br>        super.viewDidLayoutSubviews()<br>        gradientLayer.frame = gradientLayerView.bounds<br>    }</pre><p>6. layer是view上面的一層</p><p>7. 你如果漸層top是設button的底部，tableView也要設top是設button的底部。他們兩個的初始點要一樣。</p><p>8. 然後你supportTableView上方要加 tableHeaderView</p><pre> let tableViewHeaderView = UIView(frame: .init(x: 0, y: 0, width: 0, height: 30))<br> supportTableview.tableHeaderView = tableViewHeaderView</pre><p>9. 然後你layer要給他一個高度，這裡是寫死40 gradientLayerView.heightAnchor.constraint(equalToConstant: 40),</p><pre> // 設置漸層遮罩<br> gradientLayerView.topAnchor.constraint(equalTo: supportTopButton.bottomAnchor),<br> gradientLayerView.leadingAnchor.constraint(equalTo: view.leadingAnchor),<br> gradientLayerView.trailingAnchor.constraint(equalTo: view.trailingAnchor),<br> gradientLayerView.heightAnchor.constraint(equalToConstant: 40),</pre><p>10. gradientLayer.locations = [0, 1] 這裡寫0到1就是一開始直接漸層。</p><p>寫gradientLayer.locations = [0.5, 1] 寫0.5到1就是一半才開始漸層</p><pre>// 添加漸層遮罩<br>        gradientLayer.colors = [UIColor.white.cgColor, UIColor.white.withAlphaComponent(0).cgColor]<br>        gradientLayer.locations = [0, 1]<br>        gradientLayerView.layer.addSublayer(gradientLayer)</pre><p>7月23日（二）</p><p>⦿let homeViewController = UIStoryboard(name:HardcodedString.shared.strMain, bundle:nil).instantiateViewController(withIdentifier: HardcodedString.shared.strHomeViewController)</p><ol><li>name:HardcodedString.shared.strMain 是拿到Storyboard的名字</li></ol><p>strMain（main）就是他拉畫面做的Storyboard</p><p>2. HardcodedString.shared.strHomeViewController 就是拿他做的Storyboard的名字strMain（main），裡面的HardcodedString.shared.strHomeViewController，這是他名字就是HomeViewController</p><p>3. 【 很重要】固定寫法：UIApplication.shared.delegate as? AppDelegate</p><p>【 AppDelegate】掌控你APP生命週期的一個東東</p><p>【UIApplication.shared.delegate】這樣寫法就會去拿到他，固定就是這樣寫</p><p>【 拿AppDelegate就是為了拿到現在的window】</p><p>【 window就是你APP的那一整塊頁面就是window】</p><p>【 rootViewController就是他最一開始的ViewController是什麼】</p><p>4. 現在把他最一開始的ViewController，整個抽換掉，【 讓我們現在全部只有一個navigationViewController裡面只有一個detailViewController】</p><p>let navigationViewController =</p><p>UINavigationController(rootViewController: detailViewController)</p><p>delegate.window?.rootViewController = navigationViewController</p><p>5.等這個detailViewController出來之後我們再塞一個homeViewController和 listViewController給他</p><p>navigationViewController.setViewControllers([homeViewController, listViewController, detailViewController], animated: false)</p><p>6.這樣變成他整個APP只有三個ViewController，從第一個homeViewController，再到listViewController再到detailViewController。</p><p>整段完整code</p><pre>if let delegate = UIApplication.shared.delegate as? AppDelegate {<br>DispatchQueue.main.async {<br>                <br>let homeViewController = UIStoryboard(name: HardcodedString.shared.strMain, bundle: nil).instantiateViewController(withIdentifier: HardcodedString.shared.strHomeViewController)<br>let listViewController = NotificationListTableViewController()<br>let detailViewController = NotificationDetailViewController()<br>let navigationViewController = UINavigationController(rootViewController: detailViewController)<br>delegate.window?.rootViewController = navigationViewController<br>navigationViewController.setViewControllers([homeViewController, listViewController, detailViewController], animated: false)<br>                <br>            }</pre><p>⦿你要在view1上面做漸層效果，你就在view1上面再加一個view2，然後在view2上面加入漸層，並加viewDidLayoutSubviews</p><pre>let gradientLayer = CAGradientLayer()<br>gradientLayer.colors = [UIColor.white.cgColor,UIColor.white.withAlphaComponent(0.67).cgColor, UIColor.white.withAlphaComponent(0).cgColor]<br>gradientLayer.locations = [0,0.5, 1]<br>view2.layer.addSublayer(gradientLayer)<br><br>override func viewDidLayoutSubviews() {<br>        gradientLayer.frame = view2.bounds<br>    }</pre><ol><li>如果漸層非常淡，就調整這塊</li></ol><pre>gradientLayer.colors = [UIColor.white.cgColor,UIColor.white.withAlphaComponent(0.67).cgColor, UIColor.white.withAlphaComponent(0).cgColor]<br>gradientLayer.locations = [0,0.5, 1]</pre><p>2. 他現在有3塊。100% , 67% , 0%，所以這裡就這樣設定UIColor.white.cgColor =&gt; 100％ 表示全白UIColor.white.withAlphaComponent(0).cgColor =&gt; 0% 表示全透明</p><pre>gradientLayer.colors = [UIColor.white.cgColor,<br>UIColor.white.withAlphaComponent(0.67).cgColor, <br>UIColor.white.withAlphaComponent(0).cgColor]</pre><p>3. 所以要設３個點 0 , 一半, 全部</p><pre>gradientLayer.locations = [0,0.5, 1]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_gsmUWYwo7GyKn5nbpP_FA.png" /></figure><p>⦿你今天想要在tableView cell顯示的時候做時間排序，【這個時候你要想你這頁的資料一定是一個array】，那你就拿到這個array的時候做排序，再給tableView用，所以是在拿到資料的地方做排序</p><p>⦿你今天設autolayout要給他條件要設4個，不然他沒高度或者沒寬度，就會沒法顯示資料。</p><p>⦿你今天tableView的Header，他func是</p><pre>func tableView<br>(_ tableView: UITableView, viewForHeaderInSection section: Int) -&gt; UIView? {</pre><p>表示你要回傳一個view給他，你這時候想要header是一個lable，那你就在這個func裡面創一個UIView，再創一個UILable，再把UILable加到UIView裡面。</p><p>再把這個View return出去，他就會把他當header。</p><pre>func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -&gt; UIView? {<br>        let view = UIView()<br>        view.backgroundColor = .clear<br>        let label = UILabel()<br>        label.textColor = .black<br>        label.font = UIFont(name: &quot;NotoSans-Bold&quot;, size: 16)<br>        view.addSubview(label)<br>        label.translatesAutoresizingMaskIntoConstraints = false<br>        NSLayoutConstraint.activate([<br>            label.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 30),<br>            label.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: 0),<br>            label.topAnchor.constraint(equalTo: view.topAnchor, constant: 0),<br>            label.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -20)<br>            ])<br>        if section == 0 {<br>            label.text = &quot;Portfolio&quot;<br>         } else {<br>             label.text = &quot;Account&quot;<br>        }<br>        return view<br>    }</pre><p>⦿你Lable的字想要置中，就設定這個lb.textAlignment = .center</p><pre>var faqsDetailLable = {<br>        let lb = UILabel()<br>        lb.text = LanguageManager.shared.localized(withKey: &quot;faqs_description&quot;)<br>        lb.textColor = UIColor(hex: &quot;#767676&quot;)<br>        lb.font = UIFont(name: &quot;NotoSans-Regular&quot;, size: 16)<br>        lb.numberOfLines = 0 // 允許無限行<br>        lb.lineBreakMode = .byWordWrapping // 按單詞換行<br>        lb.textAlignment = .center<br>        return lb<br>    }()</pre><p>⦿打API應該是在要跳轉的那頁打，而不是在上一頁打完API賦值給下一頁VC，再跳轉過去，這樣你在等API會來的時候使用者就可以亂滑亂點，突然API資料回來了，突然在看的頁面被跳過去剛剛點的那頁。</p><p>你應該在使用者點完後直接跳去下一頁，在下一頁打API，要帶去下一頁的值init帶過去。</p><p>7月24日（三）</p><p>⦿你tableView用出來的方式，是創一個一般view再讓他繼承UITableViewDelegate, UITableViewDataSource（這裡只是名字取tableView，並不是創的時後選tableView，這裡創的時候是選一般View）</p><pre>class AccountTableViewController: <br>UIViewController, UITableViewDelegate, UITableViewDataSource</pre><p>這樣好處是你在可以把tableView設成一個group，每個section之間有空格間距 let tableView = UITableView(frame: .zero, style: .grouped)</p><p>再把他加到view裡面，這樣你tableView上方就可以再放一個大Lable當標題。</p><pre>override func viewDidLoad() {<br>        super.viewDidLoad()<br>        let titleLabel = UILabel()<br>        view.addSubview(titleLabel)<br><br>        view.backgroundColor = .white<br>        tableView.backgroundColor = .clear<br>        view.addSubview(tableView)<br><br>        tableView.delegate = self<br>        tableView.dataSource = self</pre><p>7月25日（四）</p><p>⦿ var didTapAction: ((Event) -&gt; Void)?</p><p>這個callBack方法你要在【 外面呼叫 】或在【 裡面呼叫】都可以</p><p>你要在【 外面賦予值 】（就是給他一個方法，參數是Event enum，然後要做什麼麼事情）或在【 裡面賦予值 】都可以。【 裡面賦予值 】就要在init的時候給他，不然你在viewDidLoad或者哪裡都會來不及給。</p><p>所以通常在外面會跳轉他的地方給。</p><pre>class PopHamburgerViewController: UIViewController {<br>    <br>    enum Event {<br>        case didTapAccount<br>        case didTapAbout<br>        case didTapHelpCenter<br>        case didTapMoreInfo<br>    }<br>    <br>    var didTapAction: ((Event) -&gt; Void)?<br><br>    @objc<br>    func accountButtonTouchUpInside(_ sender:UIButton)<br>    {<br>        dismiss(animated: false) {<br>            self.didTapAction?(.didTapAccount)<br>        }<br>    }<br>}</pre><pre>extension HomeViewController {<br><br>    //觸發hamburger跳出事件<br>    @objc func changeRouterBtnClick() {<br>        let vc = PopHamburgerViewController()<br>        vc.modalPresentationStyle = .overFullScreen<br>        vc.didTapAction = { event in<br>            switch event {<br>            case .didTapHelpCenter:<br>                let vc = HelpForCenterTableViewController()<br>                self.navigationController?.pushViewController(vc, animated: true)<br>                <br>            case .didTapAbout:<br>                let vc = AboutTableViewController()<br>                self.navigationController?.pushViewController(vc, animated: true)<br>                <br>            case .didTapAccount:<br>                let vc = AccountTableViewController()<br>                self.navigationController?.pushViewController(vc, animated: true)<br>}</pre><p>⦿可在一個VC生命週期的地方註冊監聽事件</p><pre>NotificationCenter.default.addObserver(self, <br>selector: #selector(updateHomeBranding), name: .updateHomeBranding, <br>object: nil)</pre><ol><li>用name搜尋你會找到</li></ol><pre>NotificationCenter.default.post(name: .updateHomeBranding, object: nil)</pre><p>2. 其他地方call的時候你就會被呼叫，但前提是你沒被註銷，通常在VC要結束的地方會取消監聽。</p><pre>NotificationCenter.default.removeObserver(self)</pre><p>⦿ ?的意思就是if let 解包的意思，</p><p>１．範例一就是如果是nil，就拿到nil的值</p><p>２．範例二就是如果是nil，就不做後面foreach的動作</p><pre>//範例一<br>var data = Global.homeBrandingData?.app_ui?.banners</pre><pre>//範例二<br>data?.forEach({ a in<br>            a++<br>        })</pre><p>⦿時間複雜度on是比較小一點點的意思，跟效能有關（怎樣算會比較快）</p><p>n是有幾筆的意思，[2,10,15,3]，這邊n就是4，最差最差就是算到第４個</p><p>跟資料結構有關西。</p><p>⦿找資料contains 跟 forEach寫法跟概念</p><p>１．forEach是每一筆都跑，跑到結束才停</p><p>２．contains（where 是找到一筆就出去了</p><p>contains裡面其實是一個閉包，但是就是要回傳『布林值』給他。</p><p>＄０就是代表每個物件</p><pre>var moreInfoData = Global.homeBrandingData?.app_ui?.banners<br>var isHaveMoreInfo = false<br>        <br>        moreInfoData?.forEach({ bannerData in<br>            if bannerData.tagName == &quot;promotions&quot;<br>            {<br>                isHaveMoreInfo = true<br>            }<br>        })</pre><pre>if let data = Global.homeBrandingData?.app_ui?.banners <br>, data.contains(where: { $0.tagName == &quot;promotions&quot; })<br>        {<br>            isHaveMoreInfo = false<br>        }</pre><p>⦿ 你今天是每個cell都要設特別樣式，你就可以去</p><p>class NotificationListTableViewCell 那裏寫一個</p><pre>var cellBackgroundView =<br>    {<br>        let view = UIView()<br>        view.translatesAutoresizingMaskIntoConstraints = false<br>        view.backgroundColor = UIColor(hex: &quot;#FFFFFF&quot;)<br>        view.layer.borderColor = UIColor(hex: &quot;#F9F9F9&quot;)?.cgColor<br>        view.layer.cornerRadius = 20<br>        view.layer.borderWidth = 2.0<br>        return view<br>    }()</pre><p>你就可以寫在init裡面，contentView先加cellBackgroundView，其他全部東西再加進去cellBackgroundView裡面</p><pre>override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {<br>        super.init(style: style, reuseIdentifier: reuseIdentifier)<br>        <br>        contentView.addSubview(cellBackgroundView)<br>        cellBackgroundView.addSubview(notificationImageView)<br>        cellBackgroundView.addSubview(notificationTopLable)<br>        cellBackgroundView.addSubview(notificationTimeLable)</pre><p>你想要跟下面cell有間隔，要設兩個地方第一個</p><p>１．class NotificationListTableViewCell給他的cellBackgroundView的bottomAnchor，給他跟contentView間隔多少</p><pre>cellBackgroundView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor,  <br>constant: -16)</pre><p>２．class NotificationListTableViewController: UIViewController, UITableViewDataSource, UITableViewDelegate</p><p>你的高度要給他一個動態高度，他會自己跟cell內容做調整</p><p>寫在heightForRowAt裡面寫 return UITableView.automaticDimension，但是你還要再多給他一個預設高度tableView.estimatedRowHeight = 72，他會再透過那個高度做動態調整。</p><pre>func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) <br>-&gt; CGFloat {<br>        return UITableView.automaticDimension<br>        }</pre><pre>override func viewDidLoad() {<br>        super.viewDidLoad()<br>  <br>        <br>        let titleLable = UILabel()<br>        tableView.dataSource = self<br>        tableView.delegate = self<br>        view.backgroundColor = .white<br>        view.addSubview(tableView)<br>        view.addSubview(gradientLayerView)<br>        view.addSubview(titleLable)<br>        <br>        titleLable.text = LanguageManager.shared.localized(withKey: &quot;notification_capitalize&quot;)<br>        titleLable.font = UIFont(name: &quot;NotoSans-Bold&quot;, size: 20)<br>        titleLable.textColor = UIColor(hex: &quot;#464646&quot;)<br>        titleLable.textAlignment = .center<br>        titleLable.translatesAutoresizingMaskIntoConstraints = false<br>        <br>        tableView.estimatedRowHeight = 72<br>        tableView.backgroundColor = .white<br>        tableView.separatorStyle = .none<br>        tableView.rowHeight = 65</pre><p>⦿ 今天你跟後端拿到時間，⓵會是一個String，⓶你要把他轉成Date的型別，⓷再把他轉回String做顯示。</p><p>＝&gt; 因為你一定要先轉成Date，才能判斷是不是UTC這個TimeZone</p><p>dateFormatter.timeZone = TimeZone(abbreviation: “UTC”)</p><pre>let serverTime = notificationListData[indexPath.row].publishedAt<br>        let dateFormatter = DateFormatter()<br>        dateFormatter.dateFormat = &quot;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39;Z&#39;&quot;<br>        dateFormatter.timeZone = TimeZone(abbreviation: &quot;UTC&quot;)<br>        <br>        if let utcDate = dateFormatter.date(from: serverTime) {<br>            let localDateFormatter = DateFormatter()<br>            localDateFormatter.dateFormat = &quot;yyyy-MM-dd HH:mm:ss&quot;<br>            localDateFormatter.timeZone = TimeZone.current<br>            let localTimeString =  localDateFormatter.string(from: utcDate)<br>            cell.notificationTimeLable.text = localTimeString<br>            print(localTimeString)<br>        }</pre><p>7月27日（六）</p><p>⦿一頁VC生命週期:</p><p>init -&gt; viewDidLoad -&gt; viewWillAppear -&gt; viewDidAppear</p><p>但如果你這個VC已經被deinit掉了，這段下次又會再全部重新跑一次</p><p>⦿ 我把NotificationListTableViewCell.self 這個class用</p><p>”NotificationListTableViewCell” 這個id，來去做forCellReuseIdentifier（重複使用的意思）</p><p>所以cellForRowAt的時候，你叫tableView去拿cell的時候，你是叫他去拿dequeueReusableCell（reuse的cell），withIdentifier: <br>“NotificationListTableViewCell”就會用你寫的id去找，就會找到上面註冊的cell id，所以我們就要強轉或弱轉成我們要的cell</p><p>as! NotificationListTableViewCell</p><pre>override func viewDidLoad() {<br>        super.viewDidLoad()<br>        <br>        <br>        tableView.dataSource = self<br>        tableView.delegate = self<br>        view.backgroundColor = .white<br>        view.addSubview(tableView)<br>        view.addSubview(gradientLayerView)<br>        view.addSubview(titleLable)<br>        <br>        <br>        tableView.estimatedRowHeight = 72<br>        tableView.backgroundColor = .white<br>        tableView.separatorStyle = .none<br>        tableView.rowHeight = 65<br>        tableView.translatesAutoresizingMaskIntoConstraints = false<br>tableView.register(NotificationListTableViewCell.self, forCellReuseIdentifier:<br> &quot;NotificationListTableViewCell&quot;)<br><br>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) <br>-&gt; UITableViewCell {<br>        let cell = tableView.dequeueReusableCell(withIdentifier: <br>&quot;NotificationListTableViewCell&quot;, for: indexPath) <br>as! NotificationListTableViewCell</pre><p>你自己寫那class的cell要繼承UITableViewCell</p><pre>class NotificationListTableViewCell: UITableViewCell {<br><br>    var cellBackgroundView =<br>    {<br>        let view = UIView()<br>        view.translatesAutoresizingMaskIntoConstraints = false<br>        view.backgroundColor = UIColor(hex: &quot;#FFFFFF&quot;)<br>        view.layer.borderColor = UIColor(hex: &quot;#F9F9F9&quot;)?.cgColor<br>        view.layer.cornerRadius = 20<br>        view.layer.borderWidth = 2.0<br>        return view<br>    }()</pre><p>你一種cell樣式就是寫一個class，像support樣式就有2種，表示要寫2個class</p><p>✦你一個View可以寫成一個class，就可以重複利用，就是創一個class他繼承UIView</p><pre>class DotWithLabel: UIView<br>{<br><br>}</pre><p>✤stackView專門塞資料用的addArrangSubView</p><pre>let imageView = UIImageView()<br>imageView.image = image<br>contentStackView.addArrangeSubView(imageView)</pre><p>✦未來如果你有機會使用到xib（拉圖的方式），</p><p>required init?(coder: NSCoder) 這行就一定要寫，不然就是你這個class不支援xib，但現在這個範例就算有寫required init?(coder: NSCoder)，你拉圖的方式還是會報錯，因為你裡面是寫fatalError</p><pre>class PracticeView: UIView {<br><br>    var a = UILabel()<br>    var b = UILabel()<br>    <br>    init(content:String , name:String)<br>    {<br>        a.text = content<br>        b.text = name<br>        super.init(frame: .zero)<br>    }<br>    <br>    required init?(coder: NSCoder) {<br>        fatalError(&quot;init(coder:) has not been implemented&quot;)<br>    }<br>    <br>}</pre><p>如果你要支援xib，required init?(coder: NSCoder)裡面可以改寫成這樣</p><pre>required init?(coder: NSCoder) {<br>        super.init(coder: coder)<br>    }</pre><p>✤可以按右鍵去看UIView，你會看到他支援程式碼的和xib</p><pre>@available(iOS 2.0, *)<br>@MainActor open class UIView : UIResponder, NSCoding, UIAppearance, UIAppearanceContainer, UIDynamicItem, UITraitEnvironment, UICoordinateSpace, UIFocusItem, UIFocusItemContainer, CALayerDelegate {<br><br>    open class var layerClass: AnyClass { get }<br><br>    public init(frame: CGRect)<br><br>    public init?(coder: NSCoder)<br><br>    open var isUserInteractionEnabled: Bool<br><br>    open var tag: Int<br><br>    open var layer: CALayer { get }</pre><p>✤因為view有兩種方式，寫code或者拉xib，用xib的時候都會拉一個大小給他，所以你寫code先拉大小給他就是寫在init那裡</p><pre>super.init(frame: .zero)</pre><p>★你想要動態調整東西用stackView是最快的</p><p>★你tableView可以同時註冊很多個cell，因為你一個tableView可能會有很多不同種類的cell</p><p>★if let {}跟guard let else{}，很好區分</p><p>if let {} =&gt; 你成功就進去{}</p><p>guard let else{} =&gt; 你不成功就進去{} ，所以你裡面就可以寫轉失敗的時候給他空的，或者直接‘return 什麼事也不做</p><p>✦enum可以很好去管理，你有很多種類的東西，再搭配switch 去列出來。</p><p>✪ 你也可以enum裡面再去放一個【 屬性他的型別是另一個enum】。</p><p>★你也可以讓enum繼承CaseIterable，你在產他的時候可以把所有case產出來。</p><pre>enum Catergory: CaseIterable {<br>    case general<br>    case setupNewNewtwork<br>    case extendWifi</pre><p>★他就可以讓有一個屬性叫做.allCases，他會把所有case產出來，【 所以這個data會是一個array 】</p><pre>let data = Catergory.allCases</pre><p>✪你在cellForRowAt，就可以拿到section跟section的row</p><p>用[indexPath.section] 跟 [indexPath.row]</p><pre>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) <br>-&gt; UITableViewCell {<br><br>let cellModel = data[indexPath.section].contents[indexPath.row]</pre><p>7月28日（日）</p><p>⦿你把support收合的動畫程式碼放在UIView.performWithoutAnimation {}裡面，這裡面放的東西，做的事情就不會有動畫</p><pre>UIView.performWithoutAnimation {<br>                tableView.beginUpdates()<br>                tableView.endUpdates()<br>            }</pre><p>讓cell重新去計算高度</p><p>tableView.beginUpdates()<br>tableView.endUpdates()</p><p>雖然你包在stackView裡面，但他是View是會自動收縮，但Cell不會所以你要讓tableView去計算。</p><p>⦿你一個東西看不懂的時候，你可以對他按右鍵跳過去看原生寫法</p><pre>@available(iOS 11.0, *)<br>open var maskedCorners: CACornerMask<br><br>    <br>/* Defines the curve used for rendering the rounded corners of the layer.<br> * Defaults to &#39;kCACornerCurveCircular&#39;. */<br>    <br>@available(iOS 13.0, *)<br>open var cornerCurve: CALayerCornerCurve</pre><p>這個時候你可以google，CACornerMask是什麼意思就會看到官方文件</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JNjminML4hlFXAqRG-Y3Bw.png" /></figure><p>點進去會看到你有四個屬性可以用</p><p><a href="https://developer.apple.com/documentation/quartzcore/cacornermask/2877484-layermaxxmaxycorner">layerMaxXMaxYCorner</a></p><p><a href="https://developer.apple.com/documentation/quartzcore/cacornermask/2877485-layermaxxminycorner">layerMaxXMinYCorner</a></p><p><a href="https://developer.apple.com/documentation/quartzcore/cacornermask/2877486-layerminxmaxycorner">layerMinXMaxYCorner</a></p><p><a href="https://developer.apple.com/documentation/quartzcore/cacornermask/2877487-layerminxminycorner">layerMinXMinYCorner</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IsSyuq6XW4dvKOvWVoef1g.png" /></figure><p>可參照的圖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0dc1cZB_PEukcuP0afdBmQ.png" /></figure><p>✪你改就可以寫在cellForRow，然後cornerRadius都固定設成10，</p><p>但只有在第一個indexPath.row == 0 和</p><p>最後一個indexPath.row == portfolioSectionData.count — 1</p><p>的時候有設layer，其他的時候就給空的[] 表示沒有一個地方要有圓角，不然default會吃到10</p><p>cell.cellBackgroundView.layer.maskedCorners = []</p><pre> cell.cellBackgroundView.layer.cornerRadius = 10<br>        <br>if indexPath.section == 0 {<br>     if indexPath.row == 0 {<br>cell.cellBackgroundView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]<br>            } else if indexPath.row == portfolioSectionData.count - 1 {<br>cell.cellBackgroundView.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMaxYCorner]<br>            } <br>else {<br>      cell.cellBackgroundView.layer.maskedCorners = []<br>      }</pre><p>7月29日（一）</p><p>⦿今天上下要捲動，你可以設一個scrollview，裡面會有一個contentView放一個label讓他可以上下捲動。 contenView設定左邊對齊左邊，右邊對齊右邊，他就只能上下滑動。再把上下滑的設成true。</p><p>★一個更牛B方式，如果確定裡面只會放文字，不會放圖片 =&gt; 直接用textView下去做就好。</p><p>★然後記得把使用者能不能編輯設成false</p><pre>let view = UITextView()<br>view.isEditable = false</pre><p>❋因為TextView的概念是使用者可以編輯。像是在寫日記的感覺。是一大段可以上下滑。</p><p>★好處是UITextView()很多功能，像是view.isUserInteractionEnabled = true的時候。</p><p>像是</p><pre>optional func textView(_ textView: UITextView, shouldInteractWith URL: URL, <br>in characterRange: NSRange, interaction: UITextItemInteraction) -&gt; Bool</pre><p>今天textView裡面有URL的文字，他自己會判別是URL文字，使用者點擊就會call這行（上面那段），會call這個方法，注意看他是回傳Bool，所以要告訴他使用點擊能不能作用。不行就回傳False攔截他的行為。</p><p>7月30日（二）</p><p>⦿這邊可以看到，最下面是tableView，最上面是View，所以我們只要找到tableView上面就可以找到橘色的。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_3N9B0E3gJnjf5SIWmZP_w.png" /></figure><p>如果每次進來都要看notification有沒有值，你就在這頁的ViewWillAppear那裡打API</p><p>⦿你這裡就要看到total是205筆，offset是31筆，表示你一次只會拿到31筆，下一次在打的時候，你要給參數32筆開始拿</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bxEC9XvXoCpBq9j489S27A.png" /></figure><p>★日期是可以比大小的！</p><p>字串也可以但會有問題，他是一個字一個字筆</p><p>7月31日（三）</p><p>⦿greaterThanOrEqualToConstant: 24 表示要大於等於24，表示最小可以24</p><pre>titleLabel.heightAnchor.constraint(greaterThanOrEqualToConstant: 24).<br>isActive = true</pre><p>因為他今天加在topStackView裡，所以他會自動長高，兩行字或者一行字，都會上下間隔10</p><pre>topStackview.addArrangedSubview(titleLabel)<br>titleLabel.translatesAutoresizingMaskIntoConstraints = false<br><br>titleLabel.heightAnchor.constraint(greaterThanOrEqualToConstant: 24).isActive = true<br>titleLabel.topAnchor.constraint(equalTo: topStackview.topAnchor, constant: 10).isActive = true<br>titleLabel.bottomAnchor.constraint(equalTo: topStackview.bottomAnchor, constant: -10).isActive = true</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*iEHuvGrKJ1Hnoh_hZKnkng.png" /></figure><p>然後你今天灰色會跟著長大，是因為你antoLayout這對著contentView，所以contentView有改變，你灰色就會跟著改變</p><pre>class SupportCell: UITableViewCell {<br><br>/// 灰色背景區塊(純色塊）<br>private var backgoundView: UIView = {<br>var view = UIView()<br>view.backgroundColor = UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 0.5)<br>view.layer.cornerRadius = 5<br>return view<br>}()<br><br>private func setupBackGroundGaryArea() {<br>contentView.addSubview(backgoundView)<br>backgoundView.translatesAutoresizingMaskIntoConstraints = false<br>backgoundView.leadingAnchor.constraint(equalTo: self.contentView.leadingAnchor, constant: 34).isActive = true<br>backgoundView.trailingAnchor.constraint(equalTo: self.contentView.trailingAnchor, constant: -34).isActive = true<br>backgoundView.bottomAnchor.constraint(equalTo: self.contentView.bottomAnchor, constant: -20).isActive = true<br>backgoundView.topAnchor.constraint(equalTo: self.contentView.topAnchor, constant: 0).isActive = true<br>}</pre><p>而且contentView本來就會長大，他是裝內容的東西。</p><p>✤然後這些設定都是設在UITableViewCell</p><p>⦿svg圖就不會有1x 2x 3x，但你要記得改成『Single Scale』，就只會有一張，自己自動放大縮小</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ymMs-IpeRVOtexK6Iq_0LQ.png" /></figure><p>⦿搜尋的時候很直覺搜索，apple login</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yghOYksJQBNzOGxZGgnuAQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7894465dfd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UITableView關鍵delegate和dataSource實現方法]]></title>
            <link>https://medium.com/@jason_0619/uitableview%E9%97%9C%E9%8D%B5delegate%E5%92%8Cdatasource%E5%AF%A6%E7%8F%BE%E6%96%B9%E6%B3%95-4f18625ffbab?source=rss-b87fbf9cc783------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f18625ffbab</guid>
            <dc:creator><![CDATA[Jason]]></dc:creator>
            <pubDate>Thu, 11 Apr 2024 02:31:38 GMT</pubDate>
            <atom:updated>2024-04-11T02:31:38.903Z</atom:updated>
            <content:encoded><![CDATA[<p>⧭必須實現的 UITableViewDataSource 方法</p><ol><li>tableView(_:numberOfRowsInSection:)</li></ol><p>用途:告訴表格視圖每個部分(section)有多少行(row)。</p><ul><li>實現範例</li></ul><pre>func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {<br>    // 返回某個部分的行數<br>    return myDataArray.count<br>}</pre><p>2. tableView(_:cellForRowAt:)</p><p>用途：為每一行提供一個表格視圖單元格（UITableViewCell）實例。這是表格視圖數據源協議中最重要的方法之一，因為它創建並配置了表格視圖中的每個可見行。</p><ul><li>實現範例</li></ul><pre>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {<br>    // 嘗試重用一個現有的單元格，如果沒有可重用的，則創建一個新的<br>    let cell = tableView.dequeueReusableCell(withIdentifier: &quot;MyCellIdentifier&quot;, for: indexPath)<br>    <br>    // 配置單元格...<br>    cell.textLabel?.text = myDataArray[indexPath.row]<br>    <br>    return cell<br>}</pre><p>⧭可選的 UITableViewDelegate 方法</p><p>雖然 UITableViewDelegate 方法是可選的，但它們為提高表格視圖的互動性和定制性提供了關鍵功能：</p><ol><li>tableView(_:didSelectRowAt:)</li></ol><p>用途：處理用戶選擇（點擊）某一行的事件。</p><ul><li>實現範例</li></ul><pre>func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {<br>    // 處理行選擇，例如導航到另一個視圖控制器<br>    print(&quot;選中了第 \(indexPath.row) 行&quot;)<br>}</pre><p>2. tableView(_:heightForRowAt:)</p><p>用途：設置每行的高度。</p><ul><li>實現範例</li></ul><pre>func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -&gt; CGFloat {<br>    // 返回每行的高度<br>    return 44.0 // 默認值<br>}</pre><p>▓ 總結：</p><p>UITableView 的</p><p>◆dataSource 提供了表格視圖的數據內容</p><p>◆ delegate 則提供了用戶互動和視圖外觀的定制。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f18625ffbab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[1A2B遊戲]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/1a2b%E9%81%8A%E6%88%B2-f8734938b917?source=rss-b87fbf9cc783------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8734938b917</guid>
            <dc:creator><![CDATA[Jason]]></dc:creator>
            <pubDate>Mon, 01 Apr 2024 16:26:15 GMT</pubDate>
            <atom:updated>2024-04-02T03:55:43.418Z</atom:updated>
            <content:encoded><![CDATA[<p>趕快趁今天下午主管不在，趕快寫第一個作業，感覺要被peter殺掉。</p><p>還不太會用影片，直接先上傳YT</p><p><a href="https://youtu.be/VShpULrVnMQ">https://youtu.be/VShpULrVnMQ</a></p><p>程式碼可參考：</p><pre>//<br>//  oneAtwoBViewController.swift<br>//  oneAtwoB<br>//<br>//  Created by Jason_Chen on 2024/4/1.<br>//<br><br>import UIKit<br><br>class oneAtwoBViewController: UIViewController {<br>    <br>    <br>    @IBOutlet weak var userGuessNumberUITextField: UITextField!<br>    <br>    @IBOutlet weak var hintUILable: UILabel!<br>    <br>    @IBOutlet weak var ansUILable: UILabel!<br>    <br>    var systemCreateNumber:[Int] = []<br>    <br>    var userGuessNumberInt:[Int] = []<br>    <br>    var userGuessNumberString = &quot;&quot;<br>    <br>    var userGuessNumberArray:[String] = []<br>    <br>    var reminder:[String] = []<br>    <br>    override func viewDidLoad()<br>    {<br>        super.viewDidLoad()<br>        <br>        resetSystemCreateNumber()<br>        <br>        let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(closeKeyboard))<br>        view.addGestureRecognizer(tapGestureRecognizer)<br>    }<br>    <br>    @objc func closeKeyboard()<br>    {<br>        view.endEditing(true)<br>    }<br>    <br>    func resetSystemCreateNumber()<br>    {<br>        for i in 0...3<br>        {<br>            var randomNumber:Int<br>            randomNumber = Int.random(in: 0...9)<br>            if i &gt; 0<br>            {<br>                for var j in 0..&lt;i<br>                {<br>                    while systemCreateNumber[j] == randomNumber<br>                    {<br>                        randomNumber = Int.random(in: 0...9)<br>                        <br>                        j = 0<br>                    }<br>   <br>                }<br>                systemCreateNumber.append(randomNumber)<br>            }<br>            <br>            else if i == 0<br>            {<br>                systemCreateNumber.append(randomNumber)<br>            }<br>        }<br>    }<br>    <br>    func userGuessNumber()<br>    {<br>        for i in 0...4<br>        {<br>            guard let userGuessNumber = Int(userGuessNumberUITextField.text!) else{return}<br>            var a:Int<br>            switch i<br>            {<br>            case 0:<br>                a = userGuessNumber / 1000<br>                userGuessNumberInt.append(a)<br>            case 1:<br>                a = (userGuessNumber / 100) % 10<br>                userGuessNumberInt.append(a)<br>            case 2:<br>                a = (userGuessNumber / 10) % 10<br>                userGuessNumberInt.append(a)<br>            default:<br>                if userGuessNumberInt.count == 4<br>                {<br>                    numeberMaxErrorMessage()<br>                    break<br>                }<br>                a = userGuessNumber % 10<br>                userGuessNumberInt.append(a)<br>            }<br>        }<br>    }<br>    <br>    @IBAction func showAnsUIButton(_ sender: UIButton)<br>    {<br>            for i in 0...3<br>            {<br>                ansUILable.text! += (&quot;\(systemCreateNumber[i] )&quot;)<br>            }<br>    }<br>    <br>    @IBAction func playAgainUIButton(_ sender: Any)<br>    {<br>        ansUILable.text! = &quot;&quot;<br>        systemCreateNumber = []<br>        userGuessNumberUITextField.text = &quot;&quot;<br>        reminder = []<br>        userGuessNumberArray = []<br>        resetSystemCreateNumber()<br>        hintUILable.text! = &quot;&quot;<br>    }<br>    <br>    @IBAction func sendAnsUIButton(_ sender: Any)<br>    {<br>        userGuessNumber()<br>        var a = 0<br>        var b = 0<br>        for i in 0...3<br>        {<br>            for j in 0...3<br>            {<br>                if i == j , systemCreateNumber[i] == userGuessNumberInt[j]<br>                {<br>                    a+=1<br>                }<br>                else if i != j ,systemCreateNumber[i] == userGuessNumberInt[j]<br>                {<br>                    b+=1<br>                }<br>            }<br>            userGuessNumberString += String(userGuessNumberInt[i])<br>        }<br>        <br>        userGuessNumberArray.append(userGuessNumberString)<br>        userGuessNumberString = &quot;&quot;<br>        <br>        if a == 0,b == 0<br>        {<br>            hintUILable.text! = &quot;全錯&quot;<br>        }<br>        <br>        if a == 0, b != 0<br>        {<br>            hintUILable.text! = &quot;\(b)B&quot;<br>        }<br>        <br>        if a != 0, b == 0<br>        {<br>            if a == 4<br>            {<br>                let alert = UIAlertController(title: &quot;恭喜&quot;, message: &quot;你是神&quot;, preferredStyle: .alert)<br>                let action = UIAlertAction(title: &quot;OK&quot;, style: .default)<br>                alert.addAction(action)<br>                present(alert, animated: true)<br>                hintUILable.text! = &quot;&quot;<br>            }<br>            else<br>            {<br>                hintUILable.text! = &quot;\(a)A&quot;<br>            }<br>                <br>            <br>        }<br>        <br>        if a != 0, b != 0<br>        {<br>            hintUILable.text! = &quot;\(a)A\(b)B&quot;<br>        }<br>        userGuessNumberInt = []<br>        reminder.append(hintUILable.text!)<br>    }<br>    <br>    <br>    @IBAction func buttonPressed(_ sender: Any) {<br>        view.endEditing(true)<br>    }<br>    <br>    @IBAction func dismissKeyBoard(_ sender: Any) {<br>    }<br>    <br>    @IBAction func showHistoricalReminder(_ sender: Any) <br>    {<br>        if let reminderVC = storyboard?.instantiateViewController(withIdentifier: &quot;ReminderViewController&quot;) as? ReminderViewController<br>        {<br>            reminderVC.reminder = self.reminder<br>            reminderVC.userGuess = self.userGuessNumberArray<br>            navigationController?.pushViewController(reminderVC, animated: true)<br>        }<br>    }<br><br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8734938b917" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/1a2b%E9%81%8A%E6%88%B2-f8734938b917">1A2B遊戲</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[iOS_CTS專案API對應打到往下層數(第二層)]]></title>
            <link>https://medium.com/@jason_0619/ios-cts%E5%B0%88%E6%A1%88api%E5%B0%8D%E6%87%89%E6%89%93%E5%88%B0%E5%BE%80%E4%B8%8B%E5%B1%A4%E6%95%B8-%E7%AC%AC%E4%BA%8C%E5%B1%A4-ab6b132a7d58?source=rss-b87fbf9cc783------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab6b132a7d58</guid>
            <dc:creator><![CDATA[Jason]]></dc:creator>
            <pubDate>Thu, 21 Mar 2024 08:11:19 GMT</pubDate>
            <atom:updated>2024-03-22T06:56:57.772Z</atom:updated>
            <content:encoded><![CDATA[<p>❁ConnectionManager</p><p>func CheckDeviceUid、func getRouterToken、func refreshToken、func checkCloudLogined、func reSignInWithSimpnic、func reSignInWithGoogle、func cloudSignInWithGoogle、func cloudSignInWithApple</p><p>(ExtendWiFiHomeVC的func getMeshTotalNodes、ProfileChangePasswordVC的func checkCloudStatus、DeleteNodeVC的func checkCloudStatus、WiFiSettingsVC的func checkCloudStatus、WiFiSSIDAndPasswordVC的func checkCloudStatus)</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>❁ConnectionManager</p><p>func refreshToken、func cloudSignInWithGoogle、func cloudSignInWithApple、func checkToken、func checkTokenNoCheckVC、func CheckDeviceUid、func getRouterToken、func checkCloudLogined、func reSignInWithGoogle、func reSignInWithApple</p><p>(「ProfileChangePasswordVC的func checkCloudStatus」、「DeleteNodeVC的func checkCloudStatus」、「WiFiSettingsVC的func checkCloudStatus」、「WiFiSSIDAndPasswordVC的func checkCloudStatus」、「HomeViewController的@IBAction func congratDonAction、override func viewWillAppear、PersonalProfileSettingsVC的override func viewWillAppear」、「CloudTLSManager2的func sendKeepaliveCommand」、「ConnectionTypeRestartForOBVC的@objc func checSocket、@objc private func becomeActive」、「ExtendWiFiHomeVC的func initTimer、func getMeshTotalNodes、func tlsResponse」、「SelectDeviceVC的func connectToWiFiDelegate、func socketFail」、「SetupManagerVC2的func connectToWiFiDelegate、func socketFail、func tlsResponseFail」、「NetworkMapV2Controller的@objc func checkConnect」、「ExtendWiFiHomeVC的func getMeshTotalNodes」)</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>❁CloudTLSManager2</p><p>func cloudSignIn、func sendAMUserGet、func sendAMUserPwdUpdate、func sendAMUserDelete、func sendGWCommand、func sendAMGetHomeBranding、func sendHomeIdByMac、func sendGetUidByMac、func sendCommandToRelayWithDictionary、func sendAMHomeGet、func sendAmDeviceBindSet、func sendAmUserDelete、func sendAmDeviceBindUnset、func socketDidSecure</p><p>(「CTSBaseViewController的func reSignInWithSimpnic、override func viewWillAppear、」、「ConnectionManager的func reSignInWithSimpnic、func refreshToken、func homeGetDone」、「LaunchVC2的func reSignInWithSimpnic」、「AppStateManager的func reSignInWithSimpnic、func initTLSDone」、「ConnectionTypeRestartForOBVC的func AmDeviceBindSetResult、func checkWifiIsReady、func homeGetDone」、「ProfileChangePasswordVC的func changeThePassword」、「PersonalProfileSettingsVC的func showDeleteAccountAlert、func AmDeviceBindUnsetSuccess、」、「HomeViewController的func noticeSocketResponse、func congratDonAction、func updateHomeBranding」、「DevicesListVC的func getDeviceList、func getNodeList、func setDeviceType、func setDeviceName、func deleteDevice、func setTimeoutAPI、func kickoutAPI」、「SelectDeviceVC的func getModeName_forCloud、func autoLogin_forCloud、func connectToWiFiDelegate、func AmGetHomeIdByMac404」、「CloudLoginVC的func homeGetDone」、「CloudTLSManager的func sendGWCommand」、「ConnectionTypeVC的func getCabled、func setPersonalize、func setConnectionType」、「CreateAccountAndLoginVC的func homeGetDone」、「SetupManagerVC2的func connectToWiFiDelegate」)</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>❁AppStateManager</p><p>func cloudSignInWithGoogle、func cloudSignInWithApple、func checkCloudLogined、func reSignInWithSimpnic、func reSignInWithGoogle、func reSignInWithApple、func isDeviceUid、func autoLoginWiFiRouter、func getMainWiFi、func initTLSDone</p><p>(「WiFiSettingsVC的func becomeActive」)</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab6b132a7d58" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[怎麼看是哪個套件]]></title>
            <link>https://medium.com/@jason_0619/%E6%80%8E%E9%BA%BC%E7%9C%8B%E6%98%AF%E5%93%AA%E5%80%8B%E5%A5%97%E4%BB%B6-945d8fe7f2fd?source=rss-b87fbf9cc783------2</link>
            <guid isPermaLink="false">https://medium.com/p/945d8fe7f2fd</guid>
            <dc:creator><![CDATA[Jason]]></dc:creator>
            <pubDate>Thu, 21 Mar 2024 03:32:03 GMT</pubDate>
            <atom:updated>2024-03-21T03:32:03.703Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U-gBgxpQGFU2CEY0anjYJA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7SigHQivVjYY2T77Q4YwXw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0X5Ln5_kbXW84sZ7rP1fWA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=945d8fe7f2fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iOS_CTS專案API對應打到往下層數(第一層)]]></title>
            <link>https://medium.com/@jason_0619/ios-cts%E5%B0%88%E6%A1%88api%E5%B0%8D%E6%87%89%E6%89%93%E5%88%B0%E5%BE%80%E4%B8%8B%E5%B1%A4%E6%95%B8-804ce5b398e5?source=rss-b87fbf9cc783------2</link>
            <guid isPermaLink="false">https://medium.com/p/804ce5b398e5</guid>
            <dc:creator><![CDATA[Jason]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 05:22:25 GMT</pubDate>
            <atom:updated>2024-03-21T09:08:15.254Z</atom:updated>
            <content:encoded><![CDATA[<p>❁RouterApiManager</p><p>◆ConnectionManager</p><p>func CheckDeviceUid、func getRouterToken、func refreshToken、func checkCloudLogined、func reSignInWithSimpnic、func reSignInWithGoogle、func cloudSignInWithGoogle、func cloudSignInWithApple</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆DevicesListVC</p><p>func getNodeList</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆SelectDeviceVC</p><p>func getModelName、func autoLogin、func retryToConnectWiFi、func connectToWiFiDelegate、func JoinNetwork、func socketFail、func tlsResponse、func AmGetHomeIdByMac404、func AmGetUidByMacError</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆LoginBottomSheetVC</p><p>func getToken</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆ConnectionTypeVC</p><p>func getCabled、func setPersonalize、func setConnectionType、func isDeviceUid_ForOnBoarding、func initAppStatusChangeHandler、func checkIsOnline、func checkCloudStatus</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆ConnectionTypeRestartForOBVC</p><p>func getModelName、func checkInternetService、func setCtrLoadingUIStatus、func setUIStatus</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆ConnectionTypeRestartVC</p><p>func getModelName、func checkInternetService、func setUIStatus、func enterForground、func retryToConnectWiFi、func connectToCapWiFi</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆SetupManagerVC2</p><p>func getModelName、func autoLogin、func retryToConnectWiFi、func JoinNetwork、func tlsResponseFail、func AmGetHomeIdByMac404</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆OnboardingCongratsVC</p><p>func getUserInfo、func getMainWiFi</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆ForceDeleteNodeVC</p><p>func deleteNode</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆SettingLocationVC</p><p>func setNodeLocation</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆SettingDeviceVC</p><p>func setDeviceName</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆WiFiSettingsVC</p><p>func getConnectionType、func restartSystem、func becomeActive、func connectionTypeGetDone、func initTLSDone</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆WiFiSSIDAndPasswordVC</p><p>func setMainWiFi、func checkCloudStatus、func initTLSDone</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆AppStateManager</p><p>func isDeviceUid、func autoLoginWiFiRouter、func getMainWiFi、func checkCloudLogined、func reSignInWithSimpnic、func reSignInWithGoogle、func reSignInWithApple、func cloudSignInWithGoogle、func cloudSignInWithApple、func initTLSDone</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆APITestViewController</p><p>func getnodes、func getModelName</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆ExtendWiFiHomeVC</p><p>func shareBackhaul、func getBackhaulShared、func getMeshTotalNodes、func getMeshTotalNodes_s、func initTimer、func startProgress、func tlsResponse</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆ConnectivityRestartVC</p><p>func getModelName、func becomeActive、func enterForground、func retryToConnectWiFi、func connectToCapWiFi</p><p>==============================================================================================================================</p><p>❁CloudResetPasswordVC</p><p>◆ForgotPasswordVerificationVC</p><p>func changeThePassword</p><p>==============================================================================================================================</p><p>❁CloudAPIManager</p><p>◆CTSBaseViewController</p><p>func cloudSignInWithGoogle、func cloudSignInWithApple、func checkRelogin、func becomeActive、func baseInitNetStatusChangeHandler、func checkRelogin、func startReloginOrSocketReconnect、func checkCloudLogined、func reSignInWithGoogle、func reSignInWithApple</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆ConnectionManager</p><p>func refreshToken、func cloudSignInWithGoogle、func cloudSignInWithApple、func checkToken、func checkTokenNoCheckVC、func CheckDeviceUid、func getRouterToken、func checkCloudLogined、func reSignInWithGoogle、func reSignInWithApple</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆CloudLoginVC</p><p>func cloudSignIn、func loginBtnClick</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆CloudResetPasswordVC</p><p>func changeThePassword</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆CloudCreatePasswordVC</p><p>func cloudAccountSignUp</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆CloudCreateAccountVerificationVC</p><p>func cloudSignIn、func resendEmail、func becomeActive、func updateTimer</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆ForgotPasswordVC</p><p>func forgetPasswordSendEmail、func changeBtnClick</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆ForgotPasswordVerificationVC</p><p>func forgetPasswordOTP、func forgetPasswordSendEmail</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆CloudTLSManager</p><p>func cloudSignIn、func sendAmHomeNew、func sendAMHomeGet、func sendAmDeviceBindSet、func sendAmUserDelete、func sendAmDeviceBindUnset、func sendAMUserGet、func sendAMUserPwdUpdate、func sendAMUserDelete、func sendGWCommand、func sendAMGetHomeBranding、func sendCommandToRelayWithDictionary、func socketDidSecure</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆CloudTLSManager2</p><p>func cloudSignIn、func sendAMUserGet、func sendAMUserPwdUpdate、func sendAMUserDelete、func sendGWCommand、func sendAMGetHomeBranding、func sendHomeIdByMac、func sendGetUidByMac、func sendCommandToRelayWithDictionary、func sendAMHomeGet、func sendAmDeviceBindSet、func sendAmUserDelete、func sendAmDeviceBindUnset、func socketDidSecure</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆CreateAccountAndLoginVC</p><p>func cloudSignInWithGoogle、func cloudSignInWithApple、func handleGoogleSignIn、func authorizationController、func homeGetDone</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆LaunchVC2</p><p>func cloudSignInWithGoogle、func cloudSignInWithApple、func CheckAPIServerNetworkStatus、func retryTapped、func processCheck、 func checkCloudLogined、func reSignInWithGoogle、func reSignInWithApple、func reSignInWithSimpnic</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>◆AppStateManager</p><p>func cloudSignInWithGoogle、func cloudSignInWithApple、func checkCloudLogined、func reSignInWithSimpnic、func reSignInWithGoogle、func reSignInWithApple、func isDeviceUid、func autoLoginWiFiRouter、func getMainWiFi、func initTLSDone</p><p>==============================================================================================================================</p><p>❁AppStateManager</p><p>◆WiFiSettingsVC</p><p>func becomeActive、func checkCloudStatus、func connectionTypeGetDone、func getConnectionType、func restartSystem、func initTLSDone</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=804ce5b398e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>