解释这段代码 static func todayAchievementText(cicle: SHThreeCycle, complete: @escaping(_ notifText: String) -> Void) { let corpus = SHSThreeCirclesCorpus() let model = SHSThreeCircleCorpusModel() model.typeName = "TodayAchievement" switch cicle { case .SHThreeCycleCalorie: model.categorizaName = "DoneCalorie" case .SHThreeCycleDuration: model.categorizaName = "DoneIntensity" case .SHThreeCycleAvtive: model.categorizaName = "DoneActiveH" case .SHThreeCycleAll: model.categorizaName = "DoneAll" } _ = corpus.getLanguageTypeParams(corpusModel: model) let keyDicts = Dictionary<String, String>() corpus.getLanguageParamsTotal(corpusModel: model, paramsDic: keyDicts) { responseStr in complete(responseStr) } }
时间: 2023-03-28 09:04:06 浏览: 83
这段代码是一个静态函数,名为todayAchievementText,它接受一个SHThreeCycle类型的参数cicle和一个闭包complete。函数内部创建了一个SHSThreeCirclesCorpus实例和一个SHSThreeCircleCorpusModel实例,并设置了model的typeName和categorizaName属性。接着调用了corpus的getLanguageTypeParams方法和getLanguageParamsTotal方法,最终将得到的responseStr传给闭包complete。具体实现细节需要查看SHSThreeCirclesCorpus和SHSThreeCircleCorpusModel的代码。
阅读全文