Closed AhmedAmineZribi closed 2 years ago
@AhmedAmineZribi I can run the code normally on a 13.7 emulator:
and I do run it in live projects targeting iOS 13, so I'd guess that the issue is in the unfortunate combo of SwiftUI 1 and the rest of your codebase. I'd have to see the view that actually contains the FlowLayout to tell more, but iOS 13 is known for having issues with nested GeometryReaders.
is that FlowLayout 1.0.0 or 1.0.3 ?
in my side I used with 1.0.0 and I have error I think it related to GeometryReaders in this function :
private func viewHeightReader(_ binding: Binding<CGFloat>) -> some View { return GeometryReader { geo -> Color in DispatchQueue.main.async { binding.wrappedValue = geo.frame(in: .local).size.height } return .clear } }
It's 1.0.3, always use the latest version as it contains bug fixes and additional improvements compared to previous ones.
Hello @gordan-glavas-codecons, I update my package to 13.7 and still have the same issues in func viewHeightReader. The frame in geo . you can see Screen shot
In my case I use flow layout not in all frame like you make, as you see in my last screen shot it was in a section .
binding.wrappedValue = geo.size.height
binding.wrappedValue = geo.frame(in: .local).size.height
Can you please make this changes ?
There is an important difference between the geo.size.height
and geo.frame(in: .local).size.height
, with the former being the expected size, and latter being the actually measured one, hence just using the former would be wrong for most use-cases.
The issue you're seeing is a result of stacked GeometryReaders not working on iOS 13 and is somewhat specific to your layout. I recommend creating a fork of this repo and making the change in it, since I can't make the change here without compromising stability.
then I used package of FlowLayout in my project and I run the app with iOS 13.7, the app crash. Could you please make changes for < iOS 14 Thank you