Skip to content

When the content of the view changes, PageView cannot be refreshed #5

Description

@paulpaulzhang

This is a very useful and great library, but there are some minor issues:
I use coredata as the data source. When the data changes, pageview cannot refresh the current page. It needs to be refreshed after switching the page.
I found that it is because the go function has added a check on whether the selection belongs to the current view. Removing the check will make it normal. I hope it can be fixed

func go(

  to value: SelectionValue,

  in pageViewController: UIPageViewController,

  animated: Bool = true

  ) {

    guard let currentViewController = pageViewController.viewControllers?.first as? ContainerViewController else {

      return

    }

     // delete this guard, It can be refreshed normally.
    guard currentViewController.value != value else {

      return

    }

    pageViewController.setViewControllers(

      [makeViewController(value)],

      direction: .forward,

      animated: animated

    )

  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions