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

Implemented 'pagerTabStripViewController:didMoveToIndex:' delegate method #53

Closed
wants to merge 15 commits into from

Conversation

AnthonyMDev
Copy link

This should close #38

EDIT: willMoveToIndex: has since been added.
This has been tested thoroughly and works as expected on all view controllers.

I've realized that there really is no good way to implement a 'willMoveToIndex:' delegate method, because the scroll view will already have moved half-way to the other view controller in the case of the user dragging the scroll view.

This method is called after the scroll view has completed all scrolling animations to reach the new view controller.

@AnthonyMDev
Copy link
Author

@michaelEllisUy Any chance that this PR will get accepted? If not, I need to fork the repository so that I can use it for my personal project.

Thanks

…into development

Conflicts:
	XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.m
@AnthonyMDev
Copy link
Author

@michaelEllisUy I've fixed the merge conflicts on this PR. Hoping to see this implemented soon?

@AnthonyMDev
Copy link
Author

Just realized I've been tagging the wrong person when asking about the PR. Apparently @mtnbarreto is the author for this. Sorry.
@mtnbarreto do you think this will be implemented?

@AnthonyMDev
Copy link
Author

This PR has been brought up to date with master.
I've also added a willMoveToIndex: delegate method that works perfectly.

@mtnbarreto Any chance that I can get a response on this PR? I'm using this in a production application right now and have to create and keep updated my own private version of the Pod is a drag.

Thanks

Anthony Miller added 3 commits December 28, 2015 15:39
…into development

Conflicts:
	XLPagerTabStrip/Demo/Storyboard.storyboard
	XLPagerTabStrip/XL/Views/XLButtonBarView.h
	XLPagerTabStrip/XL/Views/XLButtonBarView.m
@AnthonyMDev
Copy link
Author

I see that there have been a bunch of changes that have caused merge conflicts for this PR. I'd be happy to resolve the merge conflicts if you are interested in pulling this in still? Otherwise, feel free to let me know and close the request.

@fedejordanolx
Copy link

I think this can be very useful

@kajensen
Copy link

kajensen commented Jan 23, 2017

How is this not part of this library? And this has 3400 stars..

~ line 250 of PagerTabStripViewController.swift

        if changeCurrentIndex {
            didMove(oldCurrentIndex, toIndex: newCurrentIndex)
        }
        
        if let progressiveDeledate = self as? PagerTabStripIsProgressiveDelegate, pagerBehaviour.isProgressiveIndicator {
            
            let (fromIndex, toIndex, scrollPercentage) = progressiveIndicatorData(virtualPage)
            progressiveDeledate.updateIndicator(for: self, fromIndex: fromIndex, toIndex: toIndex, withProgressPercentage: scrollPercentage, indexWasChanged: changeCurrentIndex)
        }
        else{
            delegate?.updateIndicator(for: self, fromIndex: min(oldCurrentIndex, pagerViewControllers.count - 1), toIndex: newCurrentIndex)
        }
    }
    
    open func didMove(_ fromIndex: Int, toIndex: Int) {
        
    }

Perhaps I will make my own pull request in a bit

@mtnbarreto
Copy link
Member

@AnthonyMDev thanks for contributing but the base code has changed too much to merge these changes. In addition to that i don't want to make the library more complex to use.

@mtnbarreto mtnbarreto closed this Jan 26, 2017
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

Successfully merging this pull request may close these issues.

New Feature: Delegate methods notification of page change
4 participants