Xcode自动完成:"+1 more"的含义是什么?

huangapple go评论60阅读模式
英文:

Xcode Autocompletion: Meaning of "+1 more"?

问题

"在这里的"+1 more"是什么意思?"

英文:

What is meant here with "+1 more"?

Xcode自动完成:"+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&lt;S&gt;(_ label: S, @ViewBuilder content: @escaping () -&gt; Content) where S : StringProtocol

and the "+1 more" refers to this other overload:

init(_ titleKey: LocalizedStringKey, @ViewBuilder content: @escaping () -&gt; 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.

huangapple
  • 本文由 发表于 2023年5月7日 13:38:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/76192351.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定