Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ios): prevent modal windows from being swiped down #11057

Merged
merged 20 commits into from
Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6d31046
chore(ios) : Added support for Xcode 11 / iOS 13 dev environment
vijaysingh-axway Jun 4, 2019
749c396
Merge branch 'master' into TIMOB-27125
vijaysingh-axway Jun 11, 2019
877accd
Merge branch 'master' into TIMOB-27125
vijaysingh-axway Jun 20, 2019
e5bd9fc
feat(iOS): Removed IS_XCODE_9 constants from code
vijaysingh-axway Jun 24, 2019
1484cad
Merge branch 'master' into TIMOB-27125
vijaysingh-axway Jun 24, 2019
719c9f9
Merge branch 'master' into TIMOB-27125
vijaysingh-axway Jul 12, 2019
b326074
chore(ios): prevent modal windows from being swiped down
vijaysingh-axway Jul 17, 2019
5ea4b6b
feat(android): Optimized TextField/TextArea handling in TableView (#1…
jquick-axway Jul 15, 2019
badda41
feat(ios): updated constants
vijaysingh-axway Jul 18, 2019
0415939
test(db): bump up timeouts
sgtcoolguy Jul 16, 2019
c734de8
test(db): drop long-running query count to 5000 rows
sgtcoolguy Jul 16, 2019
50121c3
test(db): bump up timeout
sgtcoolguy Jul 16, 2019
f40d639
test: migrate overridden tests to suite
sgtcoolguy Jul 17, 2019
a8c8922
Merge branch 'master' into TIMOB-27169
vijaysingh-axway Jul 18, 2019
b2fddd0
Merge branch 'master' into TIMOB-27169
vijaysingh-axway Jul 22, 2019
5cc3bd1
chore(ios): prevent modal windows from being swiped down
vijaysingh-axway Aug 16, 2019
0a98b0e
Merge branch 'master' into TIMOB-27169
vijaysingh-axway Aug 16, 2019
2587c2c
Merge branch 'master' into TIMOB-27169
vijaysingh-axway Aug 21, 2019
9974ced
Merge branch 'master' into TIMOB-27169
vijaysingh-axway Aug 27, 2019
60232ed
Merge branch 'master' into TIMOB-27169
vijaysingh-axway Aug 29, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions apidoc/Titanium/UI/Window.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1843,6 +1843,16 @@ properties:
type: Boolean
default: false

- name: forceModal
summary: Indicates whether the window enforces modal behaviour.
description: |
Set to `true` to prevent interactive dismissal of window while it is onscreen.
type: Boolean
default: false
platforms: [iphone, ipad]
since: "8.2.0"
osver: {ios: {min: "13.0"}}

- name: modalStyle
summary: Presentation style of this modal window.
platforms: [iphone, ipad]
Expand Down
1 change: 1 addition & 0 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiWindowProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
BOOL focussed;
BOOL isModal;
BOOL hidesStatusBar;
BOOL forceModal;
UIStatusBarStyle barStyle;
TiViewProxy<TiTab> *tab;
TiAnimation *openAnimation;
Expand Down
10 changes: 9 additions & 1 deletion iphone/TitaniumKit/TitaniumKit/Sources/API/TiWindowProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ - (void)_destroy

- (void)_configure
{
forceModal = YES;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this set to YES here when it's default value is defined as NO?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For iOS 12, by default it is true. So it is set 'YES' in configuration. For iOS 13, it'll take its value from property. Inside

  • (void)viewDidDisappear:(BOOL)animated
    {
    if (isModal && closing) {
    if (isModal && (closing || !forceModal)) {
    [self windowDidClose];
    }
    }
    we are checking this property for firing close event in iOS 13, which should not affect iOS 12 behaviour. So set it YES.
    This has been already tested by Hans and Donovan.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I was just wondering what's the reason behind that. Thanks for the explanation.

[self replaceValue:nil forKey:@"orientationModes" notification:NO];
[super _configure];
}
Expand Down Expand Up @@ -560,6 +561,13 @@ - (void)openOnUIThread:(NSArray *)args
[theController setModalPresentationStyle:style];
}
}

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
janvennemann marked this conversation as resolved.
Show resolved Hide resolved
if ([TiUtils isIOSVersionOrGreater:@"13.0"]) {
forceModal = [TiUtils boolValue:@"forceModal" properties:dict def:NO];
theController.modalInPresentation = forceModal;
}
#endif
BOOL animated = [TiUtils boolValue:@"animated" properties:dict def:YES];
[[TiApp app] showModalController:theController animated:animated];
} else {
Expand Down Expand Up @@ -733,7 +741,7 @@ - (void)viewDidAppear:(BOOL)animated
}
- (void)viewDidDisappear:(BOOL)animated
{
if (isModal && closing) {
if (isModal && (closing || !forceModal)) {
[self windowDidClose];
}
}
Expand Down