0
我在我的應用程序中有各種fetcher類,我想創建一個名爲Fetcher
的協議。帶變量輸入參數列表的協議中的函數聲明
我所有的提取器類具有功能,如 final func fetch(code: String) -> Void
,final func fetch() -> Void
,final func fetch(department: String, registrationYear: String) -> Void
因此,我試圖創建本協議作爲
protocol Fetcher {
static func fetch(_)
}
但是,它不接受這種做法。
你有什麼建議嗎?
作爲旁註;它並不總是必須有String
類型的輸入,我需要更通用的解決方案。謝謝。