fluentui-system-icons/ios
Nick Romano ce3dd40fd9
GitHub migration (#4)
2020-05-31 15:39:16 -04:00
..
FluentIcons Update iOS asset catalog 2020-05-29 18:30:46 +00:00
FluentIcons.xcodeproj Merged PR 2677: Add macOS support to icon library 2020-05-27 21:25:50 +00:00
FluentIcons.xcworkspace Merged PR 2427: Merge library to master 2020-01-24 17:56:51 +00:00
FluentIconsExample Merged PR 2616: Address legal review guidances 2020-05-12 21:17:46 +00:00
FluentIcons_ExampleMacOS Merged PR 2677: Add macOS support to icon library 2020-05-27 21:25:50 +00:00
Pods Merged PR 2677: Add macOS support to icon library 2020-05-27 21:25:50 +00:00
remove-unused-fluent-icons Merged PR 2609: Validate list of icons to keep provided by React Native 2020-05-11 20:40:57 +00:00
.swiftformat Merged PR 2561: Update unused asset script 2020-04-29 18:39:04 +00:00
BUILD.gn Update iOS asset catalog 2020-05-26 23:20:25 +00:00
FluentIcons.podspec GitHub migration (#4) 2020-05-31 15:39:16 -04:00
FluentIcons_Example.entitlements Merged PR 2427: Merge library to master 2020-01-24 17:56:51 +00:00
Podfile Merged PR 2677: Add macOS support to icon library 2020-05-27 21:25:50 +00:00
Podfile.lock Merged PR 2677: Add macOS support to icon library 2020-05-27 21:25:50 +00:00
README.md GitHub migration (#4) 2020-05-31 15:39:16 -04:00

README.md

FluentIcons iOS

fluent design icons

Installation

Cocoapods

use_frameworks!
pod "FluentIcons", git: "https://github.com/microsoft/fluent-system-icons.git", tag: "1.1.2"

Carthage

git "git@github.com:microsoft/fluent-system-icons.git" "1.1.2"

Usage

iOS

import FluentIcons

UIImage(fluent: .appStore24Filled)

# To specify a tint color
let imageView = UIImage(fluent: .appStore24Regular)
imageView.tintColor = .label

# or
let imageView = UIImage(fluent: .appStore24Regular, tintColor: .label)

macOS

import FluentIcons

NSImage.fluentIcon(.appStore24Filled)

Benefits

1. No more missing assets!

By using the enum FluentIcon.myIcon24Regular you can be sure that the icon exists in your app at compile time.

No more risky stringly typed UIImage(named: "")!

2. Only includes what you use

At build/release time you can run the following script to ensure all unused assets are stripped from the app:

Cocoapods

ICON_SOURCE_PATH="./Pods/FluentIcons"

$ICON_SOURCE_PATH/ios/remove-unused-fluent-icons/run \
	--path-to-source-code "." \
	--path-to-fluent-icon-source $ICON_SOURCE_PATH

Carthage

ICON_SOURCE_PATH="./Carthage/Checkouts/fluent-mobile-icons"

$ICON_SOURCE_PATH/ios/remove-unused-fluent-icons/run \
	--path-to-source-code "." \
	--path-to-fluent-icon-source $ICON_SOURCE_PATH

carthage build --platform iOS fluent-mobile-icons

Optionally if you are using React Native or are referencing icons outside of your codebase, you can pass an icon list to prevent these icons from being removed.

--path-to-list-of-icons-to-keep OutlookReactNativeKit/ReactResources/FluentIcons.txt

3. Consistent asset rendering

All non-color icons are rendered as template images so you can easily apply a tintColor to your UIImageView or UIButton. You no longer need to specify .withRenderingMode(.alwaysTemplate) in case you're unsure the asset was misconfigured.

FAQ

1. Will this increase my apps build size

No, but please remember to set setup the script using the instructions above ^ to strip out all unused assets.

2. Why are their assets of different sizes? Can't all PDFs be scaled?

Technically they can! But design has tailored each icon to each specific size. For example, smaller icons generally have less detail in the image.