Swiftpack.co - stateman92/SizePreferenceKey as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by stateman92.
stateman92/SizePreferenceKey 0.0.2
Extend SwiftUI with a new PreferenceKey that holds the View's size! 🛠
⭐️ 2
🕓 15 weeks ago
iOS
.package(url: "https://github.com/stateman92/SizePreferenceKey.git", from: "0.0.2")

SizePreferenceKey

Extend SwiftUI with a new PreferenceKey that holds the View's size! 🛠

Setup

Add the following to Package.swift:

.package(url: "https://github.com/stateman92/SizePreferenceKey", exact: .init(0, 0, 2))

Or add the package in Xcode.

Usage

Text("Hello, world!")
    .readSize {
        print("Text size: \($0)")
    }

For details see the Example app.

GitHub

link
Stars: 2
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics