Unverified Commit 3e95d873 authored by 谭真's avatar 谭真 Committed by GitHub

Merge pull request #1399 from iAllenC/master

支持SPM,修改NSBundle+TZImagePicker.m以适配SPM安装
parents ea5d8c81 4b772bbe
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "TZImagePickerController",
platforms: [.iOS(.v8)],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "TZImagePickerController",
targets: ["TZImagePickerController"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "TZImagePickerController",
path: "TZImagePickerController/TZImagePickerController",
resources: [.process("TZImagePickerController.bundle")],
publicHeadersPath: ".",
cSettings: [
.define("TZ_SPM")
]
)
]
)
......@@ -12,7 +12,11 @@
@implementation NSBundle (TZImagePicker)
+ (NSBundle *)tz_imagePickerBundle {
#ifdef TZ_SPM
NSBundle *bundle = SWIFTPM_MODULE_BUNDLE;
#else
NSBundle *bundle = [NSBundle bundleForClass:[TZImagePickerController class]];
#endif
NSURL *url = [bundle URLForResource:@"TZImagePickerController" withExtension:@"bundle"];
bundle = [NSBundle bundleWithURL:url];
return bundle;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment