There is a "BUG" on iOS and with SwiftUI.
I have created a small project that you can download to reproduce it.
Here the issue: On swipe with the configuration tabViewStyle the memory is always increasing and never released. Without it, no problem.
TabView {
ImageComponent(name: "jupiter")
.tabItem {
Label("Jupiter", systemImage: "circle.fill")
}
ImageComponent(name: "saturn")
.tabItem {
Label("Saturn", systemImage: "circle.fill")
}
ImageComponent(name: "neptun")
.tabItem {
Label("Neptun", systemImage: "circle.fill")
}
ImageComponent(name: "uranus")
.tabItem {
Label("Uranus", systemImage: "circle.fill")
}
ImageComponent(name: "pluto")
.tabItem {
Label("Pluto", systemImage: "circle.fill")
}
}
.tabViewStyle(PageTabViewStyle()) // MEMORY ISSUE HERE ON SWIPING. IF REMOVED, IT'S OK.
}
The link for the project if you need it. Github Project