-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(ios): guard new picker types #12020
Conversation
|
iphone/Classes/TiUIiOSProxy.m
Outdated
@@ -192,6 +192,7 @@ - (NSNumber *)ROW_ACTION_STYLE_NORMAL | |||
|
|||
#ifdef USE_TI_UIPICKER | |||
|
|||
#if __IPHONE_13_4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure of the typical guards used on the iOS codebase. Looks like we tend to use __IPHONE_OS_VERSION_MAX_ALLOWED
? Also, I think e may want the guards to be placed inside each method so if it's not defined we return the -1 value that we return in the runtime guard case where iOS < 13.4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to see if there was any form of existing IS_SDK_IOS_XYZ
and the only similar thing I found was this in TiUIWebViewProxy https://github.com/appcelerator/titanium_mobile/blob/840b0d279f79248d1511fc518fa28fda9573be73/iphone/Classes/TiUIWebViewProxy.m#L619
I wasn't sure which form is right, a new IS_SDK_IOS_134
or this one that seems to be built in (or the difference of them).
Edit: For the positioning, I just matched the same as the iOS 14 guard. Should that also be moved into the method to allow returning -1 on <14?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ewanharris 1. __IPHONE_OS_VERSION_MAX_ALLOWED is preferred way.
2. Positioning is fine.
3. Need to guard in function https://github.com/appcelerator/titanium_mobile/blob/00f4b58d03678d1a266fa9a75713f938556f105a/iphone/Classes/TiUIPicker.m#L182 as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as requested!
a6cb3cd
to
7f7cb2c
Compare
iphone/iphone/Titanium_Prefix.pch
Outdated
@@ -17,6 +17,12 @@ | |||
#define IS_SDK_IOS_14 false | |||
#endif | |||
|
|||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130400 | |||
#define IS_SDK_IOS_134 true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to change this macro to IS_SDK_IOS_13_4. Convention should be IS_SDK_IOS_major_minor.
Everything else looks good.
JIRA: https://jira.appcelerator.org/browse/TIMOB-28112
Keeps compatibility with the stated xcode versions, from what I can tell this seems safe to use? It fixes the issue on 11.3.1 for me and I assume it's backwards compatible