I want implement OnBoard Screen in SwiftUI. For that reason, I used TabView. It works perfectly. But I got this warning 'animation' was deprecated in iOS 15.0. How I implement withAnimation or animation(_:value:) to fulfil my goal.
VStack(spacing: 34) {
TabView(selection: $currentIndex) {
ForEach(viewModel.getOnBoards(), id: \.id) { onboard in
OnBoardItemView(onBoard: onboard)
}
}
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
.animation(.easeInOut(duration: 1.0))
.transition(.slide)
Spacer()
ItemIndicatorView(
totalNumberOfItem: 3,
current: $currentIndex
)
ControllerView(
currentIndex: $currentIndex,
totalNumberOfItem: 3,
onboard: viewModel.getOnBoardItemAt(position: currentIndex-1)
)
}