Skip to content

Add Swift Package Manager Support #20

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 1 commit into from
Jun 5, 2025
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
21 changes: 0 additions & 21 deletions .github/workflows/build-test.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install
run: pod install
uses: actions/checkout@v4
- name: Build
run: xcodebuild build-for-testing -workspace tiff-ios.xcworkspace -scheme tiff-ios -destination 'platform=iOS Simulator,OS=latest,name=iPhone 14'
run: swift build
- name: Test
run: swift test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ Pods
xcuserdata/
*.swp
Carthage/
.build/
.swiftpm/
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ Adheres to [Semantic Versioning](http://semver.org/).

---

## 4.0.3 (TBD)
## 5.0.0 (6-5-2025)

* TBD
* Swift Package Manager Support
* Updated bundle resource loading for the test image files
* Cocoapods and carthage removed

## [4.0.2](https://github.com/ngageoint/tiff-ios/releases/tag/4.0.2) (11-06-2023)

Expand Down
Empty file removed Cartfile
Empty file.
Empty file removed Cartfile.resolved
Empty file.
63 changes: 63 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// swift-tools-version: 5.10

import PackageDescription

let package = Package(
name: "TIFF",
platforms: [
.iOS(.v13), .macOS(.v12)
],
products: [
.library(
name: "TIFF",
targets: ["TIFF"])
],
dependencies: [
],
targets: [
.target(
name: "TIFF",
dependencies: [
],
path: "tiff-ios"
),
.testTarget(
name: "TiffTests",
dependencies: [
"TIFF"
],
path: "tiff-iosTests",
resources: [
.copy("Resources/deflate.tiff"),
.copy("Resources/float32.tiff"),
.copy("Resources/float64.tiff"),
.copy("Resources/initial.tiff"),
.copy("Resources/int32.tiff"),
.copy("Resources/interleave.tiff"),
.copy("Resources/lzw_predictor_floating.tiff"),
.copy("Resources/lzw_predictor.tiff"),
.copy("Resources/lzw.tiff"),
.copy("Resources/overviews.tiff"),
.copy("Resources/packbits.tiff"),
.copy("Resources/quad-jpeg.tif"),
.copy("Resources/rgb.tiff"),
.copy("Resources/small.tiff"),
.copy("Resources/stripped.tiff"),
.copy("Resources/tiled.tiff"),
.copy("Resources/tiledplanar.tiff"),
.copy("Resources/tiledplanarlzw.tiff"),
.copy("Resources/uint32.tiff")
]
),
.testTarget(
name: "TiffTestsSwift",
dependencies: [
"TIFF"
],
path: "tiff-iosTests-swift",
resources: [
]
)

]
)
6 changes: 0 additions & 6 deletions Podfile

This file was deleted.

45 changes: 26 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ View the latest [Appledoc](http://ngageoint.github.io/tiff-ios/docs/api/)
#### Read ####

```objectivec
@import TIFF;

// NSData *data = ...;
// NSString *file = ...;
Expand Down Expand Up @@ -79,42 +80,48 @@ NSData *data = [TIFFWriter writeTiffToDataWithImage:tiffImage];

### Build ###

[![Build & Test](https://github.com/ngageoint/tiff-ios/workflows/Build%20&%20Test/badge.svg)](https://github.com/ngageoint/tiff-ios/actions/workflows/build-test.yml)
[![Build](https://github.com/ngageoint/tiff-ios/workflows/Build/badge.svg)](https://github.com/ngageoint/tiff-ios/actions/workflows/build.yml)

Build this repository using Xcode and/or CocoaPods:
Build this repository using Swift Package Manager:

pod install

Open tiff-ios.xcworkspace in Xcode or build from command line:

xcodebuild -workspace 'tiff-ios.xcworkspace' -scheme tiff-ios build
swift build

Run tests from Xcode or from command line:

xcodebuild test -workspace 'tiff-ios.xcworkspace' -scheme tiff-ios -destination 'platform=iOS Simulator,name=iPhone 15'
swift test

### Include Library ###
Open the Swift Package in Xcode from command line:

Include this repository by specifying it in a Podfile using a supported option.
open Package.swift

Pull from [CocoaPods](https://cocoapods.org/pods/tiff-ios):
### Include Library ###

pod 'tiff-ios', '~> 4.0.2'
Use this library via SPM in your Package.swift:

Pull from GitHub:
dependencies: [
.package(url: "https://github.com/ngageoint/tiff-ios.git", branch: "release/5.0.0"),
]

Or as a tagged release:

pod 'tiff-ios', :git => 'https://github.com/ngageoint/tiff-ios.git', :branch => 'master'
pod 'tiff-ios', :git => 'https://github.com/ngageoint/tiff-ios.git', :tag => '4.0.2'
dependencies: [
.package(url: "https://github.com/ngageoint/tiff-ios.git", from: "5.0.0"),
]

Include as local project:
Reference it in your Package.swift target:

pod 'tiff-ios', :path => '../tiff-ios'
.target(
name: "MyApp",
dependencies: [
.product(name: "TIFF", package: "tiff-ios"),
],
),

### Swift ###

To use from Swift, import the tiff-ios bridging header from the Swift project's bridging header
To use from Swift:

#import "tiff-ios-Bridging-Header.h"
import TIFF

#### Read ####

Expand Down
19 changes: 0 additions & 19 deletions tiff-ios.podspec

This file was deleted.

Loading