Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] track current selected viewController #44

Closed
AYastrebov opened this issue Apr 1, 2017 · 2 comments
Closed

[Question] track current selected viewController #44

AYastrebov opened this issue Apr 1, 2017 · 2 comments

Comments

@AYastrebov
Copy link
Contributor

Hello @rechsteiner !

Is there a way to track the index of currently selected viewController, when using FixedPagingViewController ?

@rechsteiner
Copy link
Owner

Hi! It's currently not possible, but I will add this to the next release. I'm planning on adding a delegate that looks like this:

public protocol FixedPagingViewControllerDelegate : class   {
  func fixedPagingViewController(
    fixedPagingViewController: FixedPagingViewController,
    willScrollToItem: ViewControllerItem,
    atIndex index: Int)
  
  func fixedPagingViewController(
    fixedPagingViewController: FixedPagingViewController,
    didScrollToItem: ViewControllerItem,
    atIndex index: Int)
}

@rechsteiner
Copy link
Owner

Added in #46. This lets you set a FixedPagingViewControllerDelegate on the itemDelegate property, which gives you a ViewControllerItem struct that contains the selected view controller ✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants