PageTabViewStyle continuous scrolling

I have a TabView with the PageTabViewStyle, and I am trying to implement continuous scrolling. After the last page, I'd like a right swipe to go back to the first page, and on the first page, a left swipe should go to the last page. I couldn't find a default option for this, so I attempted the following modifier. The gesture doesn't seem to work directly on top of the TabView, so is there a way to implement this? Thank you!
Code Block swift
TabView(selection: $currentIndex) {
ForEach(0..<count) { item in
Text("\(item)")
}
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
            .gesture(
                DragGesture()
                    .onEnded { value in
                        if currentIndex == count-1 {
                            currentIndex = 0
                        }
                    }
            )


PageTabViewStyle continuous scrolling
 
 
Q