Skip to content

Commit e0c6a62

Browse files
committed
Add resources
1 parent 247430d commit e0c6a62

File tree

12 files changed

+8
-3
lines changed

12 files changed

+8
-3
lines changed

β€ŽPackage.swiftβ€Ž

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ let package = Package(
1414
],
1515
targets: [
1616
.target(
17-
name: "MediaEditor",
17+
name: "MediaEditor",
1818
dependencies: [
1919
.product(name: "CropViewController", package: "TOCropViewController")
20-
])
20+
],
21+
resources: [.process("Resources")])
2122
]
2223
)

β€ŽSources/Extensions/Bundle+mediaEditor.swiftβ€Ž

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ import Foundation
22

33
extension Bundle {
44
@objc public class var mediaEditor: Bundle {
5+
#if SWIFT_PACKAGE
6+
return Bundle.module
7+
#else
58
let defaultBundle = Bundle(for: MediaEditor.self)
69
// If installed with CocoaPods, resources will be in MediaEditor.bundle
710
if let bundleURL = defaultBundle.resourceURL,
8-
let resourceBundle = Bundle(url: bundleURL.appendingPathComponent("MediaEditor.bundle")) {
11+
let resourceBundle = Bundle(url: bundleURL.appendingPathComponent("MediaEditor.bundle")) {
912
return resourceBundle
1013
}
1114
// Otherwise, the default bundle is used for resources
1215
return defaultBundle
16+
#endif
1317
}
1418
}

0 commit comments

Comments
Β (0)