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, How to using load more bottom scroll #11

Closed
maxkillpo opened this issue Jun 4, 2020 · 6 comments
Closed

Question, How to using load more bottom scroll #11

maxkillpo opened this issue Jun 4, 2020 · 6 comments

Comments

@maxkillpo
Copy link

I have a problem with doing additional loading pod PullToRefreshKit
Can you recommend How to solve this problem
And there is a problem with the bounce when I switch pages

@OfTheWolf
Copy link
Owner

Your question is not clear at all. Without code or detailed explanation of what you are experiencing I can not help you.

@maxkillpo
Copy link
Author

I've added the refresh control below. It can't hold the footer.
How can I solve this problem?

I use pod PullToRefreshKit.

Self.tableView.configRefreshFooter function

@OfTheWolf
Copy link
Owner

You are probably adding it to your tableView inside bottomVC. Instead you should add it to the scrollView which you can get from func tp_scrollViewDidLoad(_ scrollView: UIScrollView)

 func tp_scrollViewDidLoad(_ scrollView: UIScrollView) {
   // use this scrollView to add refreshFooter. 
    scrollView.configRefreshFooter(container:self) { [weak self] in }
}

@maxkillpo
Copy link
Author

Not work

When additional items were added, it caused the position to malfunction.
Regardless of whether I use the function inside or outside, there is still a problem with Offset

I added at tp_scrollViewDidLoad. Still have offset issues
I added that there is still a problem with offset

Or should I use other methods? Can you recommend me

@maxkillpo
Copy link
Author

I know the problem It will happen when adding items to the tableview. This will cause the offset to malfunction

@OfTheWolf
Copy link
Owner

OfTheWolf commented Jun 20, 2020

@maxkillpo @iamarjun35

reloadPagerTabStripView() calls triggers viewControllers(for pagerTabStripController: PagerTabStripViewController) so it creates view controller instances again. moving vc instance creations outside will fix the problem.

Change the code inside viewControllers(..) to below:

.
.
.

let vc = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "BottomViewController") as! BottomViewController
        let vc1 = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "BottomViewController") as! BottomViewController
        let vc2 = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "BottomViewController") as! BottomViewController
        let vc3 = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "BottomViewController") as! BottomViewController

    // MARK: - PagerTabStripDataSource
    override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
        vc.pageIndex = 0
        vc.pageTitle = "Tweets"
        vc.count = 10
        let child_1 = vc
        
        vc1.pageIndex = 1
        vc1.pageTitle = "Tweets & replies"
        vc1.count = 1
        let child_2 = vc1
        
        vc2.pageIndex = 2
        vc2.pageTitle = "Media"
        vc2.count = 10
        let child_3 = vc2
        
        vc3.pageIndex = 3
        vc3.pageTitle = "Likes"
        vc3.count = 2
        let child_4 = vc3

        return [child_1, child_2, child_3, child_4]
    }

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