Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

Trigger refresh with VoiceOver three-finger scroll gesture #61

Open
vadim-fueled opened this issue Jul 9, 2015 · 1 comment
Open

Trigger refresh with VoiceOver three-finger scroll gesture #61

vadim-fueled opened this issue Jul 9, 2015 · 1 comment

Comments

@vadim-fueled
Copy link

The standard UIRefreshControl triggers refresh when a user swipes down with three fingers while the content is already scrolled to top.
VoiceOver users would expect the same behavior from SSPullToRefresh control.

@vadim-fueled
Copy link
Author

I ended up overriding accessibilityScroll in SSPullToRefreshView subclass like this:

override func accessibilityScroll(direction: UIAccessibilityScrollDirection) -> Bool {
    if let scrollView = self.scrollView where scrollView.contentOffset.y == -scrollView.contentInset.top && direction == .Up {
        self.startLoadingAndExpand(true, animated: true)
        UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, "Refreshing content…")
        return true
    } else {
        return false
    }
}

However it's not called directly, thus I have to call it from accessibilityScroll in my UIViewController subclass (which is called by the system)

override func accessibilityScroll(direction: UIAccessibilityScrollDirection) -> Bool {
    return self.refreshView?.accessibilityScroll(direction) ?? false
}

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

No branches or pull requests

1 participant