Extend SwiftUI with a new PreferenceKey that holds the View's size! 🛠
Add the following to Package.swift
:
.package(url: "https://github.com/stateman92/SizePreferenceKey", exact: .init(0, 0, 2))
Text("Hello, world!")
.readSize {
print("Text size: \($0)")
}
For details see the Example app.
link |
Stars: 2 |
Last commit: 2 weeks ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics