[TIMOB-23567] iOS: Close all navigation windows at once
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2016-06-28T05:09:28.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 6.0.0 |
| Components | iOS |
| Labels | ios, navigationWindow, qe-6.0.0 |
| Reporter | Hans Knöchel |
| Assignee | Hans Knöchel |
| Created | 2016-06-28T02:22:02.000+0000 |
| Updated | 2017-05-26T19:33:04.000+0000 |
Description
On iOS, the user can close all current windows that are opened in a navigation window at once (instead of closing all manually). It is commonly used, so we should expose it as well.
Proposed API:
Ti.UI.iOS.NavigationWindow.popToRootWindow
PR: https://github.com/appcelerator/titanium_mobile/pull/8091 Demo:
/** * TIMOB-23567 * * OpensMAX_WINDOWSwindows inside the navigation window stack and closes all after * reaching the 3rd window. **/ var i = 0; var MAX_WINDOWS = 3; var nav = Ti.UI.iOS.createNavigationWindow({window: createWindow(++i)}); nav.open(); function createWindow(num) { var win = Ti.UI.createWindow({title: "Window " + num, backgroundColor: "#fff"}); var btn = Ti.UI.createButton({title: (i == MAX_WINDOWS) ? "Close all windows" : ("Open Window " + (num + 1))}); win.addEventListener("close", function() { Ti.API.warn("Closing " + this.title); }); btn.addEventListener("click", function() { if (i == MAX_WINDOWS) { nav.popToRootWindow({animated: true}); i = 0; return; } nav.openWindow(createWindow(++i)); }); win.add(btn); return win; }APPROVED!
Verified as fixed. Tested On: iPhone 6 Plus 10.0.1 Device & Simulator iPhone 5S 9.3.5 Device Mac OSX El Capitan 10.11.6 Ti SDK: 6.0.0.v20160914165725 Appc Studio: 4.8.0.201609101003 Appc NPM: 4.2.8-6 App CLI: 6.0.0-42 Xcode 8.0 Node v4.4.7 *Closing ticket.*