Fix: Rename @State var count to countValue to avoid SwiftLint empty_count false positive

This commit is contained in:
phranck
2026-02-02 18:36:59 +01:00
parent 50825d61da
commit bb6b23f0da
@@ -240,14 +240,14 @@ struct StateStorageIdentityTests {
/// A view that initializes @State to 0 then immediately sets it to 42.
/// On reconstruction, the state should still be 42 (not reset to 0).
private struct CounterView: View {
@State var count = 0
@State var countValue = 0
var body: some View {
if count == 0 {
if countValue == 0 {
// First render: set to 42
count = 42
countValue = 42
}
return Text("Count:\(count)")
return Text("Count:\(countValue)")
}
}