SFSymbol Icon Template produces an icon, which can be used for:
- iOS Action Extension (iOS 15 only);
- Quick Action Shortcut;
- TabBar.
While any custom SF Symbol is supported by iOS 15, this template contains special "Guides", which draw a pixel perfect 32pt icon.
- Sketch File: https://github.com/xapp/SFSymbol-Icon-Template/blob/main/Sketch/SFSymbol-Icon.sketch
- Sketch Workspace Link: https://www.sketch.com/s/0806fd05-6f85-4ade-bb4a-d4171dbf6893
- SVG: https://github.com/xapp/SFSymbol-Icon-Template/blob/main/SVG/symbol.icon.svg
- Open template in Sketch;
- Replace "Icon" with your icon;
- Export icon in SVG format.
- In Xcode, select Assets file;
- Press "+" > "Symbol Image Set";
- Add exported icon.
Add properties to Info.plist of Action Extension.
File link: https://github.com/xapp/SFSymbol-Icon-Template/blob/main/InfoPlist/ActionExtension_Info.plist
a) Dynamically:
UIApplicationShortcutItem(type: "actionType",
localizedTitle: "Title",
localizedSubtitle: nil,
icon: UIApplicationShortcutIcon(templateImageName: "symbol.icon"),
userInfo: nil)
b) Statically, add properties to Info.plist, note: use "UIApplicationShortcutItemIconFile" key instead of "UIApplicationShortcutItemIconSymbolName"
File link: https://github.com/xapp/SFSymbol-Icon-Template/blob/main/InfoPlist/QuickAction_ShortcutItem_Info.plist
a) Set icon in Storyboard;
b) Set image property of tabBarItem:
UITabBarItem(title: "Dynamic",
image: UIImage(imageLiteralResourceName: "symbol.icon"),
selectedImage: UIImage(imageLiteralResourceName: "symbol.icon"))
Download X.app: https://apps.apple.com/app/apple-store/id1533525753?pt=119131575&ct=SFSymbol-Icon-Github-Sponsor&mt=8