Почему метод init для создания экземпляра Struct Image использует расширение Image, а не Struct Image? - PullRequest
1 голос
/ 22 февраля 2020

Метод init для создания экземпляра Text находится в 'Struct Text',

public struct Text : Equatable {

@inlinable public init(verbatim content: String)

public init<S>(_ content: S) where S : StringProtocol


public init(_ key: LocalizedStringKey, tableName: String? = nil, bundle: Bundle? = nil, comment: StaticString? = nil)


public static func == (a: Text, b: Text) -> Bool }

Метод init для создания экземпляра VStack находится в 'Struct VStack'

public struct VStack<Content> : View where Content : View {

@inlinable public init(alignment: HorizontalAlignment = .center, spacing: CGFloat? = nil, @ViewBuilder content: () -> Content)

public typealias Body = Never }

, метод init для создания экземпляра Button Struct находится в 'Struct Button'

public struct Button<Label> : View where Label : View {

public init(action: @escaping () -> Void, @ViewBuilder label: () -> Label)

public var body: some View { get }

public typealias Body = some View }

НО ПОЧЕМУ В СЛУЧАЕ Image, метод init для создания экземпляра Image Struct имеет расширение Образ? `

extension Image {   
public init(_ name: String, bundle: Bundle? = nil)


public init(_ name: String, bundle: Bundle? = nil, label: Text)

public init(decorative name: String, bundle: Bundle? = nil)

@available(OSX, unavailable)
public init(systemName: String) }

`

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...