Skip to content
This repository was archived by the owner on Jun 24, 2021. It is now read-only.

Commit 4c2bd0a

Browse files
authored
Merge pull request #40 from davidsandoz/master
Add support for WKWebView
2 parents 62a6a30 + f6e57d2 commit 4c2bd0a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: src/pulltorefresh.ios.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,14 @@ export class PullToRefresh extends PullToRefreshBase {
6363
// ensure that we can trigger the refresh, even if the content is not large enough
6464
this.content.ios.scrollView.alwaysBounceVertical = true;
6565

66+
this.content.ios.scrollView.addSubview(this.refreshControl);
67+
} else if (this.content.ios instanceof WKWebView) {
68+
// ensure that we can trigger the refresh, even if the content is not large enough
69+
this.content.ios.scrollView.alwaysBounceVertical = true;
70+
6671
this.content.ios.scrollView.addSubview(this.refreshControl);
6772
} else {
68-
throw new Error("Content must inherit from UIScrollView!");
73+
throw new Error("Content must inherit from either UIScrollView, UIWebView or WKWebView!");
6974
}
7075
}
7176

0 commit comments

Comments
 (0)