-1

as the title says I am trying to swipe between views I tried the tabview with the .tabViewStyle(PageTabViewStyle()) but that only allowed me up to 10 views it would create an error if there was more than that and it was also quite laggy the screenshots below show the problem it might not be laggy with just text but with images and all It is laggy I want to swipe between 23 views.

image with 10 views it works fine

more than 10 views doesn't work

If you don't understand what I mean you can ask me and I will do my best to respond quickly

Thanks for your replies

  • 3
    You can't return more than 10 views to the body of a SwiftUI View. The usual way to do this is to wrap 10 views in a `Group` – Abizern Aug 12 '21 at 12:22
  • 1
    Also - It's going to be laggy with images, because you are creating all the views at once, which means all the images are being loaded at once. – Abizern Aug 12 '21 at 13:34
  • Submitting your code as formatted text as opposed to a screenshot will improve the quality of your post. If you want people to help, it's best to show that you put in some effort. – Yogurt Aug 12 '21 at 19:06
  • @Biclops I submitted a screenshot so I can show the error – Isam Al Zareer Aug 13 '21 at 04:26
  • @Abizern how do I do that – Isam Al Zareer Aug 13 '21 at 04:27
  • @Abizern ok I did it and everything is fine except the little bar on the bottom the screen is white so It is invisible can I move it down a little or change its properties because it is getting in the way of the buttons – Isam Al Zareer Aug 13 '21 at 04:59
  • Submitting the code in text format to be viewed without going into a link would greatly improve the quality of the post. Just a humble suggestion. If you browse StackOverflow, you'll see code in posts, not links to pictures of code. Just trying to help a guy out. – Yogurt Aug 13 '21 at 16:53

1 Answers1

0

Thanks to Abizern he said you can just put it in a Group {} and it works:

    TabView {

       Group {
       ExampleView()
       ExampleView()
       ExampleView()
       ExampleView()
       ExampleView()
       ExampleView()
       ExampleView()
       ExampleView()
       ExampleView()
       ExampleView()
        }
       Group {
      // more views
           }
        }.tabViewStyle(PageTabViewStyle())