File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
BeyondWordsPlayer/BeyondWordsPlayer Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,15 @@ public class PlayerView: UIView {
3434 webView. isInspectable = true
3535#endif
3636 }
37+ #if SWIFT_PACKAGE
38+ guard let playerHTMLPath = Bundle . module. path ( forResource: " player " , ofType: " html " ) else {
39+ fatalError ( " player.html not found! " )
40+ }
41+ #else
3742 guard let playerHTMLPath = Bundle ( for: PlayerView . self) . path ( forResource: " player " , ofType: " html " ) else {
3843 fatalError ( " player.html not found! " )
3944 }
45+ #endif
4046 guard let playerHTMLPage = try ? String ( contentsOfFile: playerHTMLPath) else {
4147 fatalError ( " player.html could not be loaded! " )
4248 }
Original file line number Diff line number Diff line change 1+ // swift-tools-version:5.3
2+
3+ import PackageDescription
4+
5+ let package = Package (
6+ name: " BeyondWordsPlayer " ,
7+ platforms: [
8+ . iOS( . v13)
9+ ] ,
10+ products: [
11+ . library(
12+ name: " BeyondWordsPlayer " ,
13+ targets: [ " BeyondWordsPlayer " ]
14+ )
15+ ] ,
16+ targets: [
17+ . target(
18+ name: " BeyondWordsPlayer " ,
19+ path: " BeyondWordsPlayer/BeyondWordsPlayer " ,
20+ resources: [
21+ . process( " player.html " )
22+ ]
23+ )
24+ ]
25+ )
You can’t perform that action at this time.
0 commit comments