英文:
Xcode Autocompletion: Meaning of "+1 more"?
问题
"在这里的"+1 more"是什么意思?"
答案1
得分: 4
这是指存在具有相同参数标签的更多重载。这是在Xcode 14中新增的一个功能。
在这种情况下,它显示了此重载:
init<S>(_ label: S, @ViewBuilder content: @escaping () -> Content) where S : StringProtocol
而"+1 more"指的是另一个重载:
init(_ titleKey: LocalizedStringKey, @ViewBuilder content: @escaping () -> Content)
您可以展开以查看所有重载,方法是在下拉菜单中选择该行,然后按右箭头键。
请注意,它们都具有2个参数,参数的标签都是_:content:
。也就是说,第一个参数没有标签,第二个参数的标签是"content"。
英文:
It's indicating that there are more overloads with the same parameter labels. This is a new feature added in Xcode 14.
In this case, it is showing this overload:
init<S>(_ label: S, @ViewBuilder content: @escaping () -> Content) where S : StringProtocol
and the "+1 more" refers to this other overload:
init(_ titleKey: LocalizedStringKey, @ViewBuilder content: @escaping () -> Content)
You can expand to see all the overloads by selecting that row in the dropdown, and pressing the right arrow key.
Notice that both of them has 2 parameters, the labels for the parameters are both _:content:
. i.e. the first parameter has no label, and the second parameter has "content" as label.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论