diff --git a/Sources/TagsGridView/SizeReader.swift b/Sources/TagsGridView/SizeReader.swift index 1a92749..4a1bcb2 100644 --- a/Sources/TagsGridView/SizeReader.swift +++ b/Sources/TagsGridView/SizeReader.swift @@ -9,13 +9,13 @@ import SwiftUI public extension View { func readSize(onChange: @escaping (CGSize) -> Void) -> some View { - background { + background( GeometryReader { geometry in Color.clear .preference(key: SizePreferenceKey.self, value: geometry.size) } - } + ) .onPreferenceChange(SizePreferenceKey.self, perform: onChange) } } diff --git a/Tests/TagsGridViewTests/TagsGridViewTests.swift b/Tests/TagsGridViewTests/TagsGridViewTests.swift index ef7b405..1e92a5f 100644 --- a/Tests/TagsGridViewTests/TagsGridViewTests.swift +++ b/Tests/TagsGridViewTests/TagsGridViewTests.swift @@ -1,11 +1 @@ import XCTest -@testable import TagsGridView - -final class TagsGridViewTests: XCTestCase { - func testExample() throws { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct - // results. - XCTAssertEqual(TagsGridView().text, "Hello, World!") - } -}