Skip to content

Ability to decide the targetContentOffsetCenter #9

@stuffmc

Description

@stuffmc

In locateClosestPageOnPrevious:onCurrent:onNext: there's this code

    contentOffset.x + 0.5f * CGRectGetWidth(self.scrollView.frame),
    contentOffset.y + 0.5f * CGRectGetHeight(self.scrollView.frame),

which will call layoutSubview if it you're doing anything "expensive" on the MainThread it will then block while swiping. Although I agree we shouldn't have anything expensive, in the real world, for various reasons, you might have something taking .2 seconds on a device in viewDidLoad.

I figures out having 1.0f instead of 0.5f would then have this "blocking" happening only when reaching the edge — instead of in the middle.

It would be nice if we could either specify this 0.5f (or 1.0f) as a property instead of it being hard coded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions