₥ia
Based in Taipei, Taiwan GDG Taipei Women Techmakers Ambassador from April 2016 Mother vs. Toddler Premium coffee lover
Sunday, March 15, 2026
來做頭家看覓仔
Tuesday, December 19, 2023
一層又一層的 protocol
當資料來源的格式有異動時,可以利用 protocol + associatedtype + extension (如果摸不到 struct 尤其需要,摸得到可以在 struct 內繼承,也還是可以用 extension)
去做深層的 protocol
用來達成透過 protocol 取值,不用判斷 source 為何~
protocol Vendor {
var venderId: Any { get }
associatedtype BrandType: Brand
var brands: [BrandType] { get }
}
protocol Brand {
var name: String { get }
}
extension BrandA: Brand{}
extension BrandB: Brand{}
extension VenderA: Vendor {
var venderId: Any { self.id }
typealias BrandType = BrandA
}
extension VenderB: Vendor {
var venderId: Any { return self.id }
typealias BrandType = BrandB
}
func processVendor<T: Vendor>(_ vendor: T) {
print("Processing vendor with id: \(vendor.venderId)")
for brand in vendor.brands {
print("Brand name: \(brand.name)")
}
}
Thursday, October 19, 2023
Tuesday, October 10, 2023
Tuesday, September 12, 2023
iOS Architecture
TCA
https://github.com/pointfreeco/swift-composable-architecture
RIBs
https://github.com/uber/RIBs
SwiftUI + Combine
https://github.com/nalexn/clean-architecture-swiftui
