Skip to content

Commit

Permalink
fix: resources not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
historic-ek committed Jun 21, 2022
1 parent c4e9a2f commit 82188c4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Filestack.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
4599415226BBF6780039BF8F /* CustomPickerUploadController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomPickerUploadController.swift; sourceTree = "<group>"; };
45A2497426BC3A4B0078785D /* SourceProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceProvider.swift; sourceTree = "<group>"; };
45A2497626BC3A5E0078785D /* SourceProviderDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceProviderDelegate.swift; sourceTree = "<group>"; };
45BFF67A23290B1E00944028 /* Filestack.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Filestack.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
45BFF67A23290B1E00944028 /* Filestack.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Filestack.podspec; sourceTree = "<group>"; };
45BFF67B23290B1E00944028 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
45BFF67C23290B1F00944028 /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = "<group>"; };
45BFF67D23290B1F00944028 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
Expand Down
3 changes: 1 addition & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ let package = Package(
dependencies: ["FilestackSDK", "ZIPFoundation"],
exclude: ["Filestack.h", "Info.plist"],
resources: [
.copy("VERSION"),
.copy("Sources/Resources")
.copy("VERSION")
]
)
]
Expand Down
5 changes: 5 additions & 0 deletions Sources/Filestack/Public/Models/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ private typealias CompletionHandler = (_ response: CloudResponse, _ safariError:
let bundleURL = frameworkBundle.resourceURL?.appendingPathComponent("Filestack.bundle")
let resourceBundle = Bundle(url: bundleURL!)

#if SWIFT_PACKAGE
let storyboard = UIStoryboard(name: "Picker", bundle: Bundle.module)
#else
let storyboard = UIStoryboard(name: "Picker", bundle: resourceBundle)
#endif

let scene = PickerNavigationScene(client: self, storeOptions: storeOptions)

return storyboard.instantiateViewController(for: scene)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ final class MonitorViewController: UIViewController {
let frameworkBundle = Bundle(for: Self.self)
let bundleURL = frameworkBundle.resourceURL?.appendingPathComponent("Filestack.bundle")
let resourceBundle = Bundle(url: bundleURL!)
#if SWIFT_PACKAGE
super.init(nibName: nil, bundle: Bundle.module)
#else
super.init(nibName: nil, bundle: resourceBundle)
#endif

}

required init?(coder: NSCoder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ final class EditorViewController: UIViewController, UIGestureRecognizerDelegate
let bundleURL = frameworkBundle.resourceURL?.appendingPathComponent("Filestack.bundle")
let resourceBundle = Bundle(url: bundleURL!)

#if SWIFT_PACKAGE
super.init(nibName: nil, bundle: Bundle.module)
#else
super.init(nibName: nil, bundle: resourceBundle)
#endif

setupGestureRecognizer()
setupView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ private extension PhotoPickerController {
let frameworkBundle = Bundle(for: Self.self)
let bundleURL = frameworkBundle.resourceURL?.appendingPathComponent("Filestack.bundle")
let resourceBundle = Bundle(url: bundleURL!)

#if SWIFT_PACKAGE
let storyboard = UIStoryboard(name: "PhotoPicker", bundle: Bundle.module)
#else
let storyboard = UIStoryboard(name: "PhotoPicker", bundle: resourceBundle)
#endif

return storyboard.instantiateViewController(withIdentifier: name)
}
Expand Down

0 comments on commit 82188c4

Please sign in to comment.