@tomas.bek
The code above can work well
struct TestView: View {
@State var isTitleVisible: Bool = true
var body: some View {
List {
Section {
Group {
Text("Title")
}
.onAppear {
isTitleVisible = true
}
.onDisappear {
isTitleVisible = false
}
}
Section {
ForEach((0..<100), id: \.self) { i in
Text(i.formatted())
}
/// Changes the background color from green to red once the title is no more visible
.listRowBackground(isTitleVisible ? Color.green : .red)
}
}
}
}
But I still do not understand why onScrollVisibilityChange cannot work inside a List.
Post
Replies
Boosts
Views
Activity
Hi @Mikhail-Chernyshov .
I'm also a beginner like you. Before becoming as an iOS developer, I was a C++ developer. Here's some resources that maybe helpful.
When diving into a new area, we always confused what skill should we learn. I recommend this project:
developer-roadmap. Just search "iOS Roadmap" and view the important skills you should skilled in.
The tutorials on developer website can let you have a basic view about SwiftUI. It can't let you be an expert. But Apple
made a wonderful document for almost every SwiftUI apis provided for us. You can open it through Xcode (Help -> Developer Documentation). When I first use some api, I just read the document a few times to learn how to use it.
There are also some unofficial tutorials. If you like learning by watching video. I recommend you search Swiftful Thinking on YouTube(This is not an ad). This guy made many SwiftUI tutorials from beginner to expert.
Well as I concerned the best way to learn SwiftUI is start a personal project immediately. No matter how many language features you learned, there's still something you don't know when you working on the project. For me, I just watch a few videos to learn some really fundamental features (e.g: Network, asynchronous programming, SwiftData, Basic widgets like button, list). Now I'm working on my own project and everyday I learn new features in SwiftUI when I coding for it.
That's some advice I can give to you. And wish you can be an iOS expert in the future.