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

Infinite Scroll Position and Direction #30

Open
isadon opened this issue Mar 11, 2016 · 4 comments
Open

Infinite Scroll Position and Direction #30

isadon opened this issue Mar 11, 2016 · 4 comments

Comments

@isadon
Copy link

isadon commented Mar 11, 2016

How do we toggle the direction and position of the scroller in case we want to scroll infinitely upward instead of downward for example. If this is not supported can it be implemented as a feature?

@pronebird
Copy link
Owner

It's not implemented, but I think it's possible to do.

@pronebird
Copy link
Owner

@Donileo #33 is solving the direction part. With a little bit of extra work hopefully it makes it to master soon. 👍

@Flitskikker
Copy link

I'm currently using the following workaround for this.

For my table view:

class UIReversedTableView: UITableView {
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)

        self.transform = CGAffineTransformMakeScale(1, -1)
    }
}

For my table view cells:

class UIReversedTableViewCell: UITableViewCell {
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)

        self.transform = CGAffineTransformMakeScale(1, -1)
    }
}

In my view controller (viewDidLoad):

// Invert infinite scrolling indicator
let indicator = UIActivityIndicatorView(activityIndicatorStyle: .Gray)
indicator.transform = CGAffineTransformMakeScale(1, -1)
self.tableView.infiniteScrollIndicatorView = indicator

// Hide repeated lines
self.tableView.tableFooterView = UIView()

Looks hacky, but works surprisingly well thus far for me. No need to inverse your data either. 😄

@michael-mckenna
Copy link

@Flitskikker @pronebird Spent half a week trying to get upward infinite scroll working then finally ran across this library and flits comment and just wanted to say thank you both for your contributions =)

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

No branches or pull requests

4 participants