0
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
public protocol ViewModifier {

    /// The type of view representing the body.
    associatedtype Body : View

    /// Gets the current body of the caller.
    ///
    /// `content` is a proxy for the view that will have the modifier
    /// represented by `Self` applied to it.
    @ViewBuilder @MainActor func body(content: Self.Content) -> Self.Body

    /// The content view type passed to `body()`.
    typealias Content
}

What does the typealias Content part above mean?

When I looked up how to use typealias, I could only find the usual usage of "If you write as follows, StringDictionary represents Dictionary<String, T>".

typealias StringDictionary<T> = Dictionary<String, T>

Well, I was able to understand the mechanism of ViewModifier itself by looking at the explanation of the comment.

森口万太郎
  • 805
  • 6
  • 20

0 Answers0