[TIMOB-20178] iOS: Support Peek and Pop in Ti.UI.WebView
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2016-01-12T07:12:25.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 5.4.0 |
| Components | iOS |
| Labels | 3dtouch, ios, ios9, peekandpop, qe-5.4.0 |
| Reporter | Hans Knöchel |
| Assignee | Hans Knöchel |
| Created | 2015-12-27T17:44:28.000+0000 |
| Updated | 2016-06-10T17:41:18.000+0000 |
Description
iOS 9 introduced an API to support Peek and Pop (3D-Touch) in WebViews like Safari does. It is disabled by default, but users should have the ability to enable it.
PR: https://github.com/appcelerator/titanium_mobile/pull/7600 Demo:
var win = Ti.UI.createWindow({ title: "TTIMOB-19806" }); var allowsLinkPreview = false; var web = Ti.UI.createWebView({ url: "http://google.de", allowsLinkPreview: allowsLinkPreview }); win.add(web); var btn = Ti.UI.createButton({ title: "allowsLinkPreview = " + allowsLinkPreview, bottom: 0, backgroundColor: "#000", color: "#fff", width: Ti.UI.FILL, height: 40 }); btn.addEventListener("click", function() { allowsLinkPreview = !allowsLinkPreview; this.setTitle("allowsLinkPreview = " + allowsLinkPreview); web.setAllowsLinkPreview(allowsLinkPreview); }); win.add(btn); win.open();Verified as fixed,
web.setAllowsLinkPreviewnow allows Peek and Pop features to be enabled / disabled for Ti.UI.WebView. Tested On: iPhone 6S (9.3.2) Device Mac OSX El Capitan 10.11.5 Ti SDK: 5.4.0.v20160608165242 Appc Studio: 4.6.0.201605201934 Appc NPM: 4.2.7-2 App CLI: 5.4.0-15 Xcode 7.3 Node v4.2.6 *Closing ticket.*