swift
#
swift
含有「swift」關鍵字的內容
全部共 20 篇文章
排序:發佈日期新到舊
MVC v.s. MVVM 學習筆記
本文紀錄了MVC和MVVM的差異,包括各自的優缺點和最大差異,並討論了MVVM的商業邏輯應該寫在哪的問題。
Michelle Chen
發佈於
Swift開發心得
2
閱讀時間約
3
分鐘
#
MVC
#
MVVM
#
iOS
[swift]CoreBluetooth(Service)
CBCentralManager:藍芽管理中心,做外部設備搜尋、連接。 CBPeripheral:外部設備 CBCharacteristic:外部設備的特徵。 首先要在info.plist裡設定新增藍芽服務。然後做宣告,如下: var centralManager: CBCentralM
小黑
發佈於
小黑與程式的邂逅-(APP)
1
閱讀時間約
9
分鐘
#
swift
[swift]CoreBluetooth(Client)
CBCentralManager:藍芽管理中心,做外部設備搜尋、連接。 CBPeripheral:外部設備 CBCharacteristic:外部設備的特徵。 首先先宣告: var centralManager: CBCentralManager = CBCentralManager.ini
小黑
發佈於
小黑與程式的邂逅-(APP)
0
閱讀時間約
10
分鐘
#
swift
[swift]二、八、十與十六進位(負數)轉換 使用uint16、int16
十進位轉二進位(Decimal to Binary) let dec = -813 let bin = String(UInt16(bitPattern: Int16(dec)), radix: 2) print(bin) // "1111110011010011" 十進位轉八進位(Deci
小黑
發佈於
小黑與程式的邂逅-(APP)
2
閱讀時間約
4
分鐘
#
swift
#
負數
#
Int16
[swift]二、八、十與十六進位轉換
十進位轉二進位(Decimal to Binary) let dec = 813 let bin = String(dec, radix: 2) print(bin) // "1100101101" 十進位轉八進位(Decimal to Octal) let dec = 813 let o
小黑
發佈於
小黑與程式的邂逅-(APP)
1
閱讀時間約
3
分鐘
#
swift
#
八進位
#
二進位
Xcode15 擺脫closure裡[weak self]解包後的self
Xcode15的 @escaping closure裡解包後的[weak self]不必再寫 self了!! 用一個範例class Test來實驗,裡面只有一個變數a跟一個testClosure回"test",再用callTestClosure把變數a改成"test" 編譯正常!變數a成功被改成
Michelle Chen
發佈於
Swift開發心得
5
閱讀時間約
2
分鐘
#
Xcode
#
swift
Swift 操作檔案的VC - UIDocumentPickerViewController
一樣先來看官方文件 A view controller that provides access to documents or destinations outside your app’s sandbox. 其實就是讓你去讀取檔案App的東西 有兩種模式,Don’t copy the do
Michelle Chen
發佈於
Swift開發心得
4
閱讀時間約
10
分鐘
#
swift
#
讀書筆記
SwiftUI 畫出美美漸層色(ノ>ω<)ノ
漸層文字 做出像Apple Keynote主題一樣的美美漸層文字 先畫出一大塊美美漸層色,可以選自己喜歡的顏色跟角度去做喔 LinearGradient(colors: [.blue, .purple, .red], startPoint: .bottomLead
Michelle Chen
發佈於
Swift開發心得
5
閱讀時間約
2
分鐘
#
swift
#
讀書筆記
SwiftUI 排版神器-Spacer
先來看官方文件 https://developer.apple.com/documentation/swiftui/spacer Spacer A flexible space that expands along the major axis of its containing stack
Michelle Chen
發佈於
Swift開發心得
4
閱讀時間約
2
分鐘
#
swift
#
讀書筆記
Swift-Initialization
swift讀書筆記 Documentation Edit descriptiondocs.swift.org objective-c 的init 會return value,swift 不會。 所有的property都必須在Init()裡面設定初始值,或設定stored property,這種
Michelle Chen
5
閱讀時間約
11
分鐘
#
swift
#
讀書筆記
#
#
#
#
#
#
#
#
#