Bundle
var bundle = Bundle.main
if bundle.bundleURL.pathExtension == "appex" {
// Peel off two directory levels - MY_APP.app/PlugIns/MY_APP_EXTENSION.appex
let url = bundle.bundleURL.deletingLastPathComponent().deletingLastPathComponent()
if let otherBundle = Bundle(url: url) {
bundle = otherBundle
guard let dvc = UIStoryboard(name: "Main", bundle: bundle).instantiateViewController(withIdentifier: "TestViewController") as? TestViewController else { return }
self.navigationController?.pushViewController(dvc, animated: true)
}
}
let appDisplayName = bundle.object(forInfoDictionaryKey: "CFBundleDisplayName")
Plain Text
복사