File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,9 @@ import AVFoundation
77 - Returns: An image.
88 */
99func imageNamed( _ name: String ) -> UIImage {
10- let cls = BarcodeScannerViewController . self
11- var bundle = Bundle ( for: cls)
1210 let traitCollection = UITraitCollection ( displayScale: 3 )
1311
14- if let resourceBundle = bundle. resourcePath. flatMap ( { Bundle ( path: $0 + " /BarcodeScanner.bundle " ) } ) {
15- bundle = resourceBundle
16- }
17-
18- guard let image = UIImage ( named: name, in: bundle, compatibleWith: traitCollection) else {
12+ guard let image = UIImage ( named: name, in: Bundle . module, compatibleWith: traitCollection) else {
1913 return UIImage ( )
2014 }
2115
@@ -28,11 +22,7 @@ func imageNamed(_ name: String) -> UIImage {
2822 - Returns: An image.
2923 */
3024func localizedString( _ key: String ) -> String {
31- if let path = Bundle ( for: BarcodeScannerViewController . self) . resourcePath,
32- let resourceBundle = Bundle ( path: path + " /Localization.bundle " ) {
33- return resourceBundle. localizedString ( forKey: key, value: nil , table: " Localizable " )
34- }
35- return key
25+ return Bundle . module. localizedString ( forKey: key, value: nil , table: " Localizable " )
3626}
3727
3828/// Checks if the app is running in Simulator.
You can’t perform that action at this time.
0 commit comments