我一直在关注Apple的SwiftUI教程。在此过程中,我经常将Text对象与以下初始化程序一起使用:
/// Creates an instance that displays `content` verbatim.
public init<S>(_ content: S) where S : StringProtocol
Run Code Online (Sandbox Code Playgroud)
Now, in the fifth tutorial of the series, I've encountered the following usage of Text:
Text(verbatim: "")
Run Code Online (Sandbox Code Playgroud)
The description in the interface is the same as for the other initializer:
Text(verbatim: "")
Run Code Online (Sandbox Code Playgroud)
What's the two initializers for and how are they different / when would I use which?