-
-
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)(8_2_X): sf symbol handling for application shortcut #11222
Changes from 4 commits
3c3a561
7fd5b87
82401ae
bb7828f
9427a25
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
|
||
#if defined(USE_TI_UIIOSAPPLICATIONSHORTCUTS) || defined(USE_TI_UIAPPLICATIONSHORTCUTS) | ||
#import "TiUIApplicationShortcutsProxy.h" | ||
#import <TitaniumKit/TiBlob.h> | ||
#import <TitaniumKit/TiUtils.h> | ||
#ifdef USE_TI_CONTACTS | ||
#import "TiContactsPerson.h" | ||
|
@@ -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"]) { | ||
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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
} | ||
} | ||
#endif | ||
NSLog(@"[ERROR] Ti.UI.ApplicationShortcuts: Invalid icon provided, defaulting to use no icon."); | ||
return nil; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
|
||
#ifdef USE_TI_UIIOSAPPLICATIONSHORTCUTS | ||
#import "TiUIiOSApplicationShortcutsProxy.h" | ||
#import <TitaniumKit/TiBlob.h> | ||
#import <TitaniumKit/TiUtils.h> | ||
#ifdef USE_TI_CONTACTS | ||
#import "TiContactsPerson.h" | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. same as above... |
||
TiBlob *blob = (TiBlob *)value; | ||
if (blob.type == TiBlobTypeSystemImage) { | ||
return [UIApplicationShortcutIcon iconWithSystemImageName:blob.systemImageName]; | ||
} | ||
} | ||
#endif | ||
|
||
NSLog(@"[ERROR] Ti.UI.iOS.ApplicationShortcuts: Invalid icon provided, defaulting to use no icon."); | ||
return nil; | ||
} | ||
|
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.