Skip to content

watchOS + Support SwiftPM #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ Carthage/Build
# `pod install` in .travis.yml
#
Pods/

# SwiftPM
.swiftpm
.build
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode10.2
osx_image: xcode11

addons:
homebrew:
Expand Down Expand Up @@ -37,11 +37,12 @@ script:
- pod lib lint --allow-warnings

- echo Build as dynamic frameworks
- carthage update --platform ios,tvos,macos --configuration DEBUG
- carthage update --configuration DEBUG
- xcodebuild build clean -project SDWebImagePDFCoder.xcodeproj -scheme 'SDWebImagePDFCoder iOS' -sdk iphonesimulator PLATFORM_NAME=iphonesimulator -configuration Debug | xcpretty -c
- xcodebuild build clean -project SDWebImagePDFCoder.xcodeproj -scheme 'SDWebImagePDFCoder tvOS' -sdk appletvsimulator -configuration Debug | xcpretty -c
- xcodebuild build clean -project SDWebImagePDFCoder.xcodeproj -scheme 'SDWebImagePDFCoder macOS' -sdk macosx -configuration Debug | xcpretty -c
- xcodebuild build clean -project SDWebImagePDFCoder.xcodeproj -scheme 'SDWebImagePDFCoder watchOS' -sdk watchsimulator -configuration Debug | xcpretty -c

- echo Build example
- pod install --project-directory=Example
- xcodebuild build -workspace Example/SDWebImagePDFCoder.xcworkspace -scheme SDWebImagePDFCoder-Example -sdk iphonesimulator -destination 'name=iPhone 6s' -configuration Debug | xcpretty -c
- xcodebuild build -workspace Example/SDWebImagePDFCoder.xcworkspace -scheme SDWebImagePDFCoder-Example -sdk iphonesimulator -destination 'name=iPhone 8' -configuration Debug | xcpretty -c
16 changes: 16 additions & 0 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// swift-tools-version:5.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "SDWebImagePDFCoder",
platforms: [
.macOS(.v10_10), .iOS(.v8), .tvOS(.v9), .watchOS(.v2)
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "SDWebImagePDFCoder",
targets: ["SDWebImagePDFCoder"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/SDWebImage/SDWebImage.git", from: "5.1.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 which this package depends on.
.target(
name: "SDWebImagePDFCoder",
dependencies: ["SDWebImage"],
path: ".",
sources: ["SDWebImagePDFCoder/Classes"],
publicHeadersPath: "SDWebImagePDFCoder/Classes"
)
]
)
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![License](https://img.shields.io/cocoapods/l/SDWebImagePDFCoder.svg?style=flat)](https://cocoapods.org/pods/SDWebImagePDFCoder)
[![Platform](https://img.shields.io/cocoapods/p/SDWebImagePDFCoder.svg?style=flat)](https://cocoapods.org/pods/SDWebImagePDFCoder)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/SDWebImage/SDWebImagePDFCoder)
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager/)

## What's for
SDWebImagePDFCoder is a PDF coder plugin for [SDWebImage](https://github.com/rs/SDWebImage/) framework, which provide the image loading support for [PDF](https://en.wikipedia.org/wiki/Scalable_Vector_Graphics). The PDF rendering is done using Apple's built-in framework (UIKit/AppKit/Core Graphics).
Expand All @@ -17,9 +18,10 @@ You can modify the code or use some other PDF files to check the compatibility.

## Requirements

+ iOS 8
+ tvOS 9
+ macOS 10.10
+ iOS 8+
+ tvOS 9+
+ macOS 10.10+
+ watchOS 2+

## Installation

Expand All @@ -40,6 +42,18 @@ SDWebImagePDFCoder is available through [Carthage](https://github.com/Carthage/C
github "SDWebImage/SDWebImagePDFCoder"
```

#### Swift Package Manager (Xcode 11+)

SDWebImagePDFCoder is available through [Swift Package Manager](https://swift.org/package-manager).

```swift
let package = Package(
dependencies: [
.package(url: "https://github.com/SDWebImage/SDWebImagePDFCoder.git", from: "0.4")
]
)
```

## Usage

To use PDF coder, you should firstly add the `SDImagePDFCoder` to the coders manager. Then you can call the View Category method to start load PDF images.
Expand Down
1 change: 1 addition & 0 deletions SDWebImagePDFCoder.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ SDWebImageSVGCoder is a SVG coder plugin for SDWebImage framework, which provide
s.ios.deployment_target = '8.0'
s.tvos.deployment_target = '9.0'
s.osx.deployment_target = '10.10'
s.watchos.deployment_target = '2.0'

s.source_files = 'SDWebImagePDFCoder/Classes/**/*', 'SDWebImagePDFCoder/Module/SDWebImagePDFCoder.h'
s.module_map = 'SDWebImagePDFCoder/Module/SDWebImagePDFCoder.modulemap'
Expand Down
133 changes: 133 additions & 0 deletions SDWebImagePDFCoder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
objects = {

/* Begin PBXBuildFile section */
32407BE123797C7E00F9AFA4 /* SDWebImagePDFCoderDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 32CA9EC82185BDC300322AF3 /* SDWebImagePDFCoderDefine.h */; settings = {ATTRIBUTES = (Public, ); }; };
32407BE223797C7E00F9AFA4 /* SDWebImagePDFCoderDefine.m in Sources */ = {isa = PBXBuildFile; fileRef = 32CA9ECB2185BDC300322AF3 /* SDWebImagePDFCoderDefine.m */; };
32407BE323797C7E00F9AFA4 /* SDImagePDFCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 32CA9ECA2185BDC300322AF3 /* SDImagePDFCoder.h */; settings = {ATTRIBUTES = (Public, ); }; };
32407BE423797C7E00F9AFA4 /* SDImagePDFCoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 32CA9ECC2185BDC300322AF3 /* SDImagePDFCoder.m */; };
32407BE523797C8E00F9AFA4 /* SDWebImagePDFCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 32CA9EC32185BDBB00322AF3 /* SDWebImagePDFCoder.h */; settings = {ATTRIBUTES = (Public, ); }; };
32407BE723797CAD00F9AFA4 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32407BE623797CAD00F9AFA4 /* SDWebImage.framework */; };
32CA9EC42185BDBB00322AF3 /* SDWebImagePDFCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 32CA9EC32185BDBB00322AF3 /* SDWebImagePDFCoder.h */; settings = {ATTRIBUTES = (Public, ); }; };
32CA9EC52185BDBB00322AF3 /* SDWebImagePDFCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 32CA9EC32185BDBB00322AF3 /* SDWebImagePDFCoder.h */; settings = {ATTRIBUTES = (Public, ); }; };
32CA9EC62185BDBB00322AF3 /* SDWebImagePDFCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 32CA9EC32185BDBB00322AF3 /* SDWebImagePDFCoder.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand All @@ -28,6 +34,8 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
32407BD923797C0400F9AFA4 /* SDWebImagePDFCoder.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDWebImagePDFCoder.framework; sourceTree = BUILT_PRODUCTS_DIR; };
32407BE623797CAD00F9AFA4 /* SDWebImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDWebImage.framework; path = Carthage/Build/watchOS/SDWebImage.framework; sourceTree = "<group>"; };
32CA9E9C2185BC3D00322AF3 /* SDWebImagePDFCoder.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDWebImagePDFCoder.framework; sourceTree = BUILT_PRODUCTS_DIR; };
32CA9EA72185BC7400322AF3 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Module/Info.plist; sourceTree = "<group>"; };
32CA9EAE2185BCEA00322AF3 /* SDWebImagePDFCoder.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDWebImagePDFCoder.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -43,6 +51,14 @@
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
32407BD623797C0400F9AFA4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
32407BE723797CAD00F9AFA4 /* SDWebImage.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
32CA9E992185BC3D00322AF3 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -85,6 +101,7 @@
32CA9E9C2185BC3D00322AF3 /* SDWebImagePDFCoder.framework */,
32CA9EAE2185BCEA00322AF3 /* SDWebImagePDFCoder.framework */,
32CA9EBB2185BD0700322AF3 /* SDWebImagePDFCoder.framework */,
32407BD923797C0400F9AFA4 /* SDWebImagePDFCoder.framework */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -113,6 +130,7 @@
32CA9EDC2185BDEF00322AF3 /* Frameworks */ = {
isa = PBXGroup;
children = (
32407BE623797CAD00F9AFA4 /* SDWebImage.framework */,
32CA9EE12185BE0400322AF3 /* SDWebImage.framework */,
32CA9EDF2185BDFA00322AF3 /* SDWebImage.framework */,
32CA9EDD2185BDEF00322AF3 /* SDWebImage.framework */,
Expand All @@ -123,6 +141,16 @@
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
32407BD423797C0400F9AFA4 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
32407BE323797C7E00F9AFA4 /* SDImagePDFCoder.h in Headers */,
32407BE523797C8E00F9AFA4 /* SDWebImagePDFCoder.h in Headers */,
32407BE123797C7E00F9AFA4 /* SDWebImagePDFCoderDefine.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
32CA9E972185BC3D00322AF3 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -156,6 +184,24 @@
/* End PBXHeadersBuildPhase section */

/* Begin PBXNativeTarget section */
32407BD823797C0400F9AFA4 /* SDWebImagePDFCoder watchOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 32407BE023797C0400F9AFA4 /* Build configuration list for PBXNativeTarget "SDWebImagePDFCoder watchOS" */;
buildPhases = (
32407BD423797C0400F9AFA4 /* Headers */,
32407BD523797C0400F9AFA4 /* Sources */,
32407BD623797C0400F9AFA4 /* Frameworks */,
32407BD723797C0400F9AFA4 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "SDWebImagePDFCoder watchOS";
productName = "SDWebImagePDFCoder watchOS";
productReference = 32407BD923797C0400F9AFA4 /* SDWebImagePDFCoder.framework */;
productType = "com.apple.product-type.framework";
};
32CA9E9B2185BC3D00322AF3 /* SDWebImagePDFCoder iOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 32CA9EA42185BC3D00322AF3 /* Build configuration list for PBXNativeTarget "SDWebImagePDFCoder iOS" */;
Expand Down Expand Up @@ -219,6 +265,9 @@
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = SDWebImagePDFCoder;
TargetAttributes = {
32407BD823797C0400F9AFA4 = {
CreatedOnToolsVersion = 11.2;
};
32CA9E9B2185BC3D00322AF3 = {
CreatedOnToolsVersion = 10.0;
};
Expand All @@ -245,11 +294,19 @@
32CA9E9B2185BC3D00322AF3 /* SDWebImagePDFCoder iOS */,
32CA9EAD2185BCEA00322AF3 /* SDWebImagePDFCoder tvOS */,
32CA9EBA2185BD0700322AF3 /* SDWebImagePDFCoder macOS */,
32407BD823797C0400F9AFA4 /* SDWebImagePDFCoder watchOS */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
32407BD723797C0400F9AFA4 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
32CA9E9A2185BC3D00322AF3 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -274,6 +331,15 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
32407BD523797C0400F9AFA4 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
32407BE223797C7E00F9AFA4 /* SDWebImagePDFCoderDefine.m in Sources */,
32407BE423797C7E00F9AFA4 /* SDImagePDFCoder.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
32CA9E982185BC3D00322AF3 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -304,6 +370,64 @@
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
32407BDE23797C0400F9AFA4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/watchOS",
);
INFOPLIST_FILE = "$(SRCROOT)/SDWebImagePDFCoder/Module/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.SDWebImagePDFCoder-watchOS";
PRODUCT_NAME = SDWebImagePDFCoder;
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
name = Debug;
};
32407BDF23797C0400F9AFA4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/watchOS",
);
INFOPLIST_FILE = "$(SRCROOT)/SDWebImagePDFCoder/Module/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.SDWebImagePDFCoder-watchOS";
PRODUCT_NAME = SDWebImagePDFCoder;
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
name = Release;
};
32CA9EA22185BC3D00322AF3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -599,6 +723,15 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
32407BE023797C0400F9AFA4 /* Build configuration list for PBXNativeTarget "SDWebImagePDFCoder watchOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
32407BDE23797C0400F9AFA4 /* Debug */,
32407BDF23797C0400F9AFA4 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
32CA9E962185BC3C00322AF3 /* Build configuration list for PBXProject "SDWebImagePDFCoder" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
Loading