Skip to content
Discussion options

You must be logged in to vote

The issue seems to be in SwiftUIX. If you add @ViewBuilder to the content closure in the initializer you want, then it will work. You can either PR that to SwiftUIX, or you can drop this in your project:

extension PaginationView {
  public init<Data, ID>(
    axis: Axis = .horizontal,
    transitionStyle: UIPageViewController.TransitionStyle = .scroll,
    showsIndicators: Bool = true,
    @ViewBuilder // 👈 This is important
    content: () -> ForEach<Data, ID, Page>
  ) where Data.Element: Identifiable {
    self.init(
      content: .init(content()),
      axis: axis,
      transitionStyle: transitionStyle,
      showsIndicators: showsIndicators
    )
  }
}

Or if you don't want to use t…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@marcuswu0814
Comment options

@vmanot
Comment options

Answer selected by marcuswu0814
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants