File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,4 +42,6 @@ packages/react-native-icons/package-lock.json
4242# Some Fluent tooling generates this for internal tracking assistance. Make sure it doesn't get committed.
4343SvgList.txt
4444
45- .venv
45+ .venv
46+
47+ .build
Original file line number Diff line number Diff line change @@ -33,10 +33,19 @@ FluentIcons
3333 end
3434
3535 s . subspec 'Assets' do |sp |
36- # Require this to be used as a dynamic framework
37- # `resource_bundles` are unable to load around 1 in a thousand times
38- # so we need to stick to `resources` here instead.
39- sp . resource = 'ios/FluentIcons/Assets/IconAssets.xcassets'
36+ if ENV [ 'FLUENT_ICONS_USE_RESOURCE_BUNDLES' ] == '1'
37+ sp . resource_bundles = {
38+ 'FluentIcons' => [ 'ios/FluentIcons/Assets/IconAssets.xcassets' ]
39+ }
40+ sp . pod_target_xcconfig = {
41+ 'OTHER_SWIFT_FLAGS' => '-DFLUENT_ICONS_USE_RESOURCE_BUNDLES'
42+ }
43+ else
44+ # Require this to be used as a dynamic framework
45+ # `resource_bundles` are unable to load around 1 in a thousand times
46+ # so we need to stick to `resources` here instead.
47+ sp . resource = 'ios/FluentIcons/Assets/IconAssets.xcassets'
48+ end
4049 end
4150
4251 s . subspec 'RemovalScript' do |sp |
Original file line number Diff line number Diff line change @@ -9,7 +9,11 @@ import AppKit
99private class FluentIconsBundleCheck { }
1010
1111public extension NSImage {
12+ #if FLUENT_ICONS_USE_RESOURCE_BUNDLES
13+ @objc static let fluentIconBundle = Bundle ( path: Bundle ( for: FluentIconsBundleCheck . self) . path ( forResource: " FluentIcons " , ofType: " bundle " ) !)
14+ #else
1215 @objc static let fluentIconBundle = Bundle ( for: FluentIconsBundleCheck . self)
16+ #endif
1317
1418 @objc static func fluentIcon( _ fluent: FluentIcon ) -> NSImage {
1519 // Force unwrap here because the resource strings
@@ -31,7 +35,11 @@ import UIKit
3135private class FluentIconsBundleCheck { }
3236
3337public extension UIImage {
38+ #if FLUENT_ICONS_USE_RESOURCE_BUNDLES
39+ @objc static let fluentIconBundle = Bundle ( path: Bundle ( for: FluentIconsBundleCheck . self) . path ( forResource: " FluentIcons " , ofType: " bundle " ) !)
40+ #else
3441 @objc static let fluentIconBundle = Bundle ( for: FluentIconsBundleCheck . self)
42+ #endif
3543
3644 @objc convenience init ( fluent: FluentIcon ) {
3745 // Force unwrap here because the resource strings
You can’t perform that action at this time.
0 commit comments