Skip to content

Commit

Permalink
Remove force loading OmiseSDK bundle from example app
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Solovev committed Dec 28, 2023
1 parent 99c0ec5 commit ad31998
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions ExampleApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window?.tintColor = UIColor(named: "App Tint") ?? UIColor.blue

#if !INTERNAL_TEST
/// WORKAROUND:
/// Storyboards do not trigger the loading of resource bundles in Swift Packages.
/// Loading Storyboard from OmiseSDK package to use Storyboard Reference in Interface Builder
Bundle.loadStoryboard(package: "OmiseSDK", target: "OmiseSDK")
#endif

return true
}

}

extension Bundle {
static func loadStoryboard(package: String, target: String) {
let bundleName = "\(package)_\(target)"
guard
let bundleURL = Bundle.main.url(forResource: bundleName, withExtension: "bundle"),
let bundle = Bundle(url: bundleURL) else {
preconditionFailure()
}
if !bundle.isLoaded {
bundle.load()
}
}
}

0 comments on commit ad31998

Please sign in to comment.