Skip to content

Commit

Permalink
Merge pull request #8091 from hansemannn/TIMOB-23567
Browse files Browse the repository at this point in the history
[TIMOB-23567] iOS: Support closing all windows in Ti.UI.iOS.NavigationWindow at once
  • Loading branch information
cheekiatng committed Jun 28, 2016
2 parents 77a691c + 964dffa commit 6a624cd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
21 changes: 16 additions & 5 deletions apidoc/Titanium/UI/iOS/NavigationWindow.yml
Expand Up @@ -26,14 +26,14 @@ excludes:

properties:
- name: window
summary: Window to add to this navigation group.
summary: Window to add to this navigation window.
type: Titanium.UI.Window
availability: creation
optional: false

methods:
- name: closeWindow
summary: Closes a window and removes it from the navigation group.
summary: Closes a window and removes it from the navigation window.
parameters:
- name: window
summary: Window to close.
Expand All @@ -42,11 +42,11 @@ methods:
- name: options
summary: |
Options supporting a single `animated` boolean property to determine whether the window
will be animated (default) while being closed.
will be animated (default) while being closed (default: true).
type: Dictionary

- name: openWindow
summary: Opens a window within the navigation group.
summary: Opens a window within the navigation window.
parameters:
- name: window
summary: Window to open.
Expand All @@ -55,9 +55,20 @@ methods:
- name: options
summary: |
Options supporting a single `animated` boolean property to determine whether the window
will be animated (default) while being opened.
will be animated (default) while being opened (default: true).
type: Dictionary

- name: popToRootWindow
summary: Closes all windows that are currently opened inside the navigation window.
description: Note that only the `close` event of the most recently opened window is fired.
parameters:
- name: options
summary: |
Options supporting a single `animated` boolean property to determine whether the windows
will be animated (default) while being closed (default: false).
type: Dictionary
since: "6.0.0"

examples:
- title: Simple Navigation Window
example: |
Expand Down
9 changes: 9 additions & 0 deletions iphone/Classes/TiUIiOSNavWindowProxy.m
Expand Up @@ -146,6 +146,15 @@ -(void)closeWindow:(NSArray*)args
}, YES);
}

-(void)popToRootWindow:(id)args
{
ENSURE_SINGLE_ARG_OR_NIL(args, NSDictionary);

TiThreadPerformOnMainThread(^{
[navController popToRootViewControllerAnimated:[TiUtils boolValue:@"animated" properties:args def:NO]];
}, YES);
}

-(void)windowClosing:(TiWindowProxy*)window animated:(BOOL)animated
{
//NO OP NOW
Expand Down

0 comments on commit 6a624cd

Please sign in to comment.