It looks like the IntrospectionAnchorPlatformViewController and IntrospectionPlatformViewController are never deallocated even though the SwiftUI views they are wrapping are not visible on the screen. This results in dozens of them being allocated and grows memory consumption.
The code that I use is a view modifier to calculate global frame of the view using UIKit:
struct GlobalFrameCalculator: ViewModifier {
@Binding var frame: CGRect?
var callback: ((CGRect?) -> Void)?
func body(content: Content) -> some View {
content
.introspect(.view, on: .iOS(.v15, .v16, .v17, .v18)) { view in
let globalFrame = view.globalFrame
frame = globalFrame
callback?(globalFrame)
}
}
}
Is there something wrong with how I use introspect of is this a bug in the library?
Checklist
[X] I have read the README before submitting this report.
Description
It looks like the
IntrospectionAnchorPlatformViewController
andIntrospectionPlatformViewController
are never deallocated even though the SwiftUI views they are wrapping are not visible on the screen. This results in dozens of them being allocated and grows memory consumption.The code that I use is a view modifier to calculate global frame of the view using UIKit:
Is there something wrong with how I use introspect of is this a bug in the library?
Checklist
Expected behavior
No response
Actual behavior
No response
Steps to reproduce
No response
Version information
No response
Destination operating system
No response
Xcode version information
No response
Swift Compiler version information
No response