可在自己的 proposed size 中塞滿一個 Path 的 Shape。
Last updated 4 years ago
+
/* * ⭐️ required: * - 🌀Path + fit */ import SwiftUI import Extensions // 📦 Fit public struct Fit: Shape { let path: Path // Fit(path) public init(_ path: Path) { self.path = path } // `Shape` protocol requirement public func path(in rect: CGRect) -> Path { path.fit(in: rect) // 🌀Path + fit } }