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)(8_2_X): sf symbol handling for application shortcut #11222
Conversation
|
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.
docs need a tweak
@@ -211,6 +212,14 @@ - (UIApplicationShortcutIcon *)findIcon:(id)value | |||
return [UIApplicationShortcutIcon iconWithTemplateImageName:[self urlInAssetCatalog:value]]; | |||
} | |||
|
|||
#ifdef IS_SDK_IOS_13 | |||
if ([value isKindOfClass:[TiBlob class]] && [TiUtils isIOSVersionOrGreater:@"13.0"]) { |
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.
do you need to check the iOS version here if you have the ifdef guard 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.
Yes. Its needed. UIApplicationShortcutIcon's api 'iconWithSystemImageName' is not available for iOS < 13. Let's say I ran my app using sdk 8.2.1 with Xcode 11 and run on iOS 12, in that case it will give error at run time.
@@ -211,6 +212,15 @@ - (UIApplicationShortcutIcon *)findIcon:(id)value | |||
return [UIApplicationShortcutIcon iconWithTemplateImageName:[self urlInAssetCatalog:value]]; | |||
} | |||
|
|||
#ifdef IS_SDK_IOS_13 | |||
if ([value isKindOfClass:[TiBlob class]] && [TiUtils isIOSVersionOrGreater:@"13.0"]) { |
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.
same as above...
Co-Authored-By: Christopher Williams <chris.a.williams@gmail.com>
if ([value isKindOfClass:[TiBlob class]] && [TiUtils isIOSVersionOrGreater:@"13.0"]) { | ||
TiBlob *blob = (TiBlob *)value; | ||
if (blob.type == TiBlobTypeSystemImage) { | ||
return [UIApplicationShortcutIcon iconWithSystemImageName:blob.systemImageName]; |
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.
A wild guess here: Instead of creating new blob types and all this handling, why not just introduce a new systemIcon
String proxy property and pass it directly to the iconWithSystemImageName
constructor? That'd probably be around 10 lines of code in total.
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.
@hansemannn 1. UIApplicationShortcutIcon has 4 type of icons, which are getting handled from same place in SDK. And developer have to pass proper value to 'icon' property and it gets internally handled on basis of type.
2. Only one type of icon can be set at a time. Having 2 property will create confusion.
3. Similar type of handling sf symbols will be better for developer.
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.
LGTM!
FR Passed. An image blob is shown as part fo the app shortcut. Also no error is shown when adding the shortcut. |
* 8_2_X: fix(ios): properly set tint-color on image-view (tidev#11233) fix(ios)(8_2_X): sf symbol handling for application shortcut (tidev#11222) fix(ios): volume event handling (tidev#11227) fix(ios): also lookup semnantic colors in correct location for classic
https://jira.appcelerator.org/browse/TIMOB-27394