I updated my OS Xcode to iOS 15 and I'm getting this artifact when scrolling. Before the update everything scrolled fine. What's odd is when I go to the Home Screen I see similar artifacts when moving apps around (the tops get cut off).
OS: 11.6 (20G165) Xcode: 13.0 (13A233) Hardware: MBP15 2017
What I tried:
- clean
- clearing cache in
~/Library/Developer/Xcode/DerivedData/ - A different simulator
- iOS 14.5 simulator
- Deleting app
It seems to be a larger problem than just my app. Does anyone know of a workaround?
Snippet of code:
//
// ContentView.swift
// ForElTomato
//
// Created by Ran on 9/30/21.
//
import SwiftUI
struct ContentView: View {
let colors:[Color] = [Color.red, Color.blue, Color.green]
let names:[String] = ["El", "Tomato", "The Best"]
var body: some View {
ScrollView(.vertical, showsIndicators: true, content: {
LazyVStack(alignment: .center, spacing: 10, pinnedViews: [], content: {
ForEach(colors, id: \.self) { clr in
ScrollView(.horizontal, showsIndicators: false, content: {
LazyHStack(alignment: .center, spacing: 10, pinnedViews: [], content: {
ForEach(names, id: \.self) { name in
Button(action: {
//nothing
}) {
HStack {
Text(name)
}.padding(10)
}.foregroundColor(.black)
.background(clr)
.animation(.default)
}
})
})
}.padding(.leading)
})
})
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
