diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml
index b4f23fbb..06c63576 100644
--- a/.github/workflows/danger.yml
+++ b/.github/workflows/danger.yml
@@ -17,4 +17,4 @@ jobs:
with:
args: --failOnErrors --no-publish-check
env:
- GITHUB_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN || secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 0fd86ce9..caaea16d 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -12,38 +12,48 @@ concurrency:
cancel-in-progress: true
jobs:
- ios-unit-tests:
- name: iOS Unit Tests
+ unit-tests:
+ name: Unit Tests (${{ matrix.build.sdk }})
runs-on: macos-14
timeout-minutes: 30
+ strategy:
+ matrix:
+ build: [
+ { sdk: 'iphonesimulator', destination: 'platform=iOS Simulator,OS=17.5,name=iPhone 15 Pro', action: 'test' },
+ { sdk: 'xros', destination: 'platform=visionOS Simulator,OS=1.2,name=Apple Vision Pro', action: 'build' }
+ ]
steps:
- - # Checkout the repository
+ - name: Checkout the repository
uses: actions/checkout@v4
-
- - # Run Tests
- name: Run Tests iOS
+ - uses: maxim-lobanov/setup-xcode@v1
+ with:
+ xcode-version: latest-stable
+ - name: Check environment
+ run: |
+ xcodebuild -version
+ swift --version
+ - name: Run Tests
run: |
set -o pipefail && \
env NSUnbufferedIO=YES \
xcodebuild -workspace . \
-scheme "TPPDF" \
- -sdk iphonesimulator \
- -destination "OS=17.4,name=iPhone 15 Pro" \
+ -sdk "${{ matrix.build.sdk }}" \
+ -destination "${{ matrix.build.destination }}" \
-configuration Debug \
- -enableCodeCoverage YES \
+ ${{ matrix.build.action == 'test' && '-enableCodeCoverage YES' || '' }} \
-derivedDataPath /tmp/DerivedData \
-resultBundlePath test_output \
CODE_SIGNING_ALLOWED="NO" \
- test 2>&1 | tee test.log | xcbeautify
-
+ ${{ matrix.build.action }} 2>&1 | tee test.log | xcbeautify
- name: Upload test log file on error
uses: actions/upload-artifact@v4
if: failure()
with:
name: test.log
path: test.log
-
- name: Generate code coverage reports
+ if: matrix.build.action == 'test'
run: |
PROFDATA_PATH=$(find /tmp/DerivedData -name "*.profdata")
echo "Detected profdata at path: $PROFDATA_PATH"
@@ -57,17 +67,21 @@ jobs:
--format="lcov" > integration-tests.coverage.lcov
macos-unit-tests:
- name: macOS Unit Tests
+ name: Unit Tests (macos)
runs-on: macos-14
timeout-minutes: 30
steps:
- - # Checkout the repository
+ - name: Checkout the repository
uses: actions/checkout@v4
-
- - # Run Tests
- name: Run tests
+ - uses: maxim-lobanov/setup-xcode@v1
+ with:
+ xcode-version: latest-stable
+ - name: Check environment
+ run: |
+ xcodebuild -version
+ swift --version
+ - name: Run tests
run: swift test --parallel --enable-code-coverage
-
- name: Generate code coverage reports
run: |
xcrun llvm-cov export \
diff --git a/.gitignore b/.gitignore
index 5fe4d840..2ee24998 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@
## Build generated
build/
DerivedData
+test.log
## Various settings
*.pbxuser
diff --git a/Example iOS-SwiftPM/Example_iOS-SPM.xcodeproj/project.pbxproj b/Example iOS-SwiftPM/Example_iOS-SPM.xcodeproj/project.pbxproj
index 75815d45..f13fcb71 100644
--- a/Example iOS-SwiftPM/Example_iOS-SPM.xcodeproj/project.pbxproj
+++ b/Example iOS-SwiftPM/Example_iOS-SPM.xcodeproj/project.pbxproj
@@ -532,7 +532,12 @@
PRODUCT_BUNDLE_IDENTIFIER = com.techprimate.tppdf.example;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
+ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
+ SUPPORTS_MACCATALYST = NO;
+ SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,7";
+ XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Debug;
};
@@ -557,7 +562,12 @@
PRODUCT_BUNDLE_IDENTIFIER = com.techprimate.tppdf.example;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
+ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
+ SUPPORTS_MACCATALYST = NO;
+ SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,7";
+ XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Release;
};
diff --git a/README.md b/README.md
index 649d33c3..aecd8ef5 100644
--- a/README.md
+++ b/README.md
@@ -9,8 +9,12 @@
diff --git a/Shared iOS/Assets/Base.lproj/Main.storyboard b/Shared iOS/Assets/Base.lproj/Main.storyboard
index e6705b71..dc08e690 100644
--- a/Shared iOS/Assets/Base.lproj/Main.storyboard
+++ b/Shared iOS/Assets/Base.lproj/Main.storyboard
@@ -1,16 +1,16 @@
-
+
-
-
+
+
-
+
@@ -19,33 +19,37 @@
-
-
+
+
-
+
+
+
+
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
@@ -55,11 +59,11 @@
-
+
-
+
@@ -99,7 +103,7 @@
-
+
@@ -112,4 +116,12 @@
+
+
+
+
+
+
+
+
diff --git a/Shared iOS/UI/ViewController.swift b/Shared iOS/UI/ViewController.swift
index 440689d7..a25d9053 100644
--- a/Shared iOS/UI/ViewController.swift
+++ b/Shared iOS/UI/ViewController.swift
@@ -8,9 +8,10 @@
import TPPDF
import UIKit
+import WebKit
class ViewController: UIViewController {
- @IBOutlet var webView: UIWebView!
+ @IBOutlet var webView: WKWebView!
@IBOutlet var progressView: UIProgressView!
var progressObserver: NSObjectProtocol!
@@ -62,7 +63,7 @@ class ViewController: UIViewController {
DispatchQueue.main.async {
self.progressView.isHidden = true
// Load PDF into a webview from the temporary file
- self.webView.loadRequest(URLRequest(url: url))
+ self.webView.load(URLRequest(url: url))
}
} catch {
print("Error while generating PDF: " + error.localizedDescription)
diff --git a/Shared/Examples/DocumentSettingsExampleFactory.swift b/Shared/Examples/DocumentSettingsExampleFactory.swift
index bf4bc5c5..02bf058c 100644
--- a/Shared/Examples/DocumentSettingsExampleFactory.swift
+++ b/Shared/Examples/DocumentSettingsExampleFactory.swift
@@ -6,7 +6,7 @@
// Copyright © 2021 techprimate GmbH & Co. KG. All rights reserved.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Shared/Examples/GroupExampleFactory.swift b/Shared/Examples/GroupExampleFactory.swift
index 95cd1ec8..93681abc 100644
--- a/Shared/Examples/GroupExampleFactory.swift
+++ b/Shared/Examples/GroupExampleFactory.swift
@@ -6,7 +6,7 @@
// Copyright © 2022 techprimate GmbH. All rights reserved.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Shared/Examples/ImageExampleFactory.swift b/Shared/Examples/ImageExampleFactory.swift
index c1d0fb7a..7b38ffd9 100644
--- a/Shared/Examples/ImageExampleFactory.swift
+++ b/Shared/Examples/ImageExampleFactory.swift
@@ -6,7 +6,7 @@
// Copyright © 2022 techprimate GmbH. All rights reserved.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Shared/Examples/LineSeparatorExampleFactory.swift b/Shared/Examples/LineSeparatorExampleFactory.swift
index 39c41391..e67367c4 100644
--- a/Shared/Examples/LineSeparatorExampleFactory.swift
+++ b/Shared/Examples/LineSeparatorExampleFactory.swift
@@ -6,7 +6,7 @@
// Copyright © 2022 techprimate GmbH. All rights reserved.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Shared/Examples/MetadataExampleFactory.swift b/Shared/Examples/MetadataExampleFactory.swift
index e68c622b..b2ef7dff 100644
--- a/Shared/Examples/MetadataExampleFactory.swift
+++ b/Shared/Examples/MetadataExampleFactory.swift
@@ -6,7 +6,7 @@
// Copyright © 2022 techprimate GmbH. All rights reserved.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Shared/Examples/MultiSectionExampleFactory.swift b/Shared/Examples/MultiSectionExampleFactory.swift
index 789a3af3..80b79cb8 100644
--- a/Shared/Examples/MultiSectionExampleFactory.swift
+++ b/Shared/Examples/MultiSectionExampleFactory.swift
@@ -7,7 +7,7 @@
//
import TPPDF
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Shared/Examples/ObjectAttributesExampleFactory.swift b/Shared/Examples/ObjectAttributesExampleFactory.swift
index 32c9fd55..425ff5ca 100644
--- a/Shared/Examples/ObjectAttributesExampleFactory.swift
+++ b/Shared/Examples/ObjectAttributesExampleFactory.swift
@@ -6,7 +6,7 @@
// Copyright © 2022 techprimate GmbH. All rights reserved.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Shared/Examples/PaginationExampleFactory.swift b/Shared/Examples/PaginationExampleFactory.swift
index 3967f8b2..ecc5733e 100644
--- a/Shared/Examples/PaginationExampleFactory.swift
+++ b/Shared/Examples/PaginationExampleFactory.swift
@@ -6,7 +6,7 @@
// Copyright © 2022 techprimate GmbH. All rights reserved.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Shared/Examples/TableExampleFactory.swift b/Shared/Examples/TableExampleFactory.swift
index c87e6d66..99cff9f7 100644
--- a/Shared/Examples/TableExampleFactory.swift
+++ b/Shared/Examples/TableExampleFactory.swift
@@ -6,7 +6,7 @@
// Copyright © 2022 techprimate GmbH. All rights reserved.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Shared/Examples/TableOfContentsExampleFactory.swift b/Shared/Examples/TableOfContentsExampleFactory.swift
index 85eaa24c..81413a7f 100644
--- a/Shared/Examples/TableOfContentsExampleFactory.swift
+++ b/Shared/Examples/TableOfContentsExampleFactory.swift
@@ -6,7 +6,7 @@
// Copyright © 2022 techprimate GmbH. All rights reserved.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Shared/Examples/TextExampleFactory.swift b/Shared/Examples/TextExampleFactory.swift
index fff1fc74..1593899c 100644
--- a/Shared/Examples/TextExampleFactory.swift
+++ b/Shared/Examples/TextExampleFactory.swift
@@ -6,7 +6,7 @@
// Copyright © 2022 techprimate GmbH. All rights reserved.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Shared/Examples/TextStylesExampleFactory.swift b/Shared/Examples/TextStylesExampleFactory.swift
index bedca750..0bb6b264 100644
--- a/Shared/Examples/TextStylesExampleFactory.swift
+++ b/Shared/Examples/TextStylesExampleFactory.swift
@@ -6,7 +6,7 @@
// Copyright © 2022 techprimate GmbH. All rights reserved.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Document/PDFDocument.swift b/Source/API/Document/PDFDocument.swift
index a1e34f95..352c84ad 100644
--- a/Source/API/Document/PDFDocument.swift
+++ b/Source/API/Document/PDFDocument.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Graphics/PDFBezierPath+Copying.swift b/Source/API/Graphics/PDFBezierPath+Copying.swift
index 75561e91..de553b25 100644
--- a/Source/API/Graphics/PDFBezierPath+Copying.swift
+++ b/Source/API/Graphics/PDFBezierPath+Copying.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 03.06.19.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Graphics/PDFBezierPath.swift b/Source/API/Graphics/PDFBezierPath.swift
index 73375e04..605d163d 100644
--- a/Source/API/Graphics/PDFBezierPath.swift
+++ b/Source/API/Graphics/PDFBezierPath.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 01.06.19.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
@@ -198,13 +198,13 @@ public class PDFBezierPath: CustomStringConvertible {
case let .move(point):
bezierPath.move(to: calculate(point: point, in: frame))
case let .line(point):
- #if os(iOS)
+ #if os(iOS) || os(visionOS)
bezierPath.addLine(to: calculate(point: point, in: frame))
#else
bezierPath.line(to: calculate(point: point, in: frame))
#endif
case let .curve(endPoint, controlPoint1, controlPoint2):
- #if os(iOS)
+ #if os(iOS) || os(visionOS)
bezierPath.addCurve(
to: calculate(point: endPoint, in: frame),
controlPoint1: calculate(point: controlPoint1, in: frame),
@@ -218,7 +218,7 @@ public class PDFBezierPath: CustomStringConvertible {
)
#endif
case let .quadCurve(endPoint, controlPoint):
- #if os(iOS)
+ #if os(iOS) || os(visionOS)
bezierPath.addQuadCurve(
to: calculate(point: endPoint, in: frame),
controlPoint: calculate(point: controlPoint, in: frame)
@@ -230,7 +230,7 @@ public class PDFBezierPath: CustomStringConvertible {
)
#endif
case let .arc(center, radius, startAngle, endAngle, clockwise):
- #if os(iOS)
+ #if os(iOS) || os(visionOS)
bezierPath.addArc(
withCenter: calculate(point: center, in: frame),
radius: radius,
diff --git a/Source/API/Graphics/PDFBezierPathVertex.swift b/Source/API/Graphics/PDFBezierPathVertex.swift
index 3e99cd78..1d69a44d 100644
--- a/Source/API/Graphics/PDFBezierPathVertex.swift
+++ b/Source/API/Graphics/PDFBezierPathVertex.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 01.06.19.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Graphics/PDFDynamicGeometryShape.swift b/Source/API/Graphics/PDFDynamicGeometryShape.swift
index 5846b41d..57b31511 100644
--- a/Source/API/Graphics/PDFDynamicGeometryShape.swift
+++ b/Source/API/Graphics/PDFDynamicGeometryShape.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 01.06.19.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Graphics/PDFLineStyle.swift b/Source/API/Graphics/PDFLineStyle.swift
index 2bb95029..7091af26 100644
--- a/Source/API/Graphics/PDFLineStyle.swift
+++ b/Source/API/Graphics/PDFLineStyle.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 11/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Groups/PDFGroup+Objects.swift b/Source/API/Groups/PDFGroup+Objects.swift
index b40eebfb..d21497d4 100644
--- a/Source/API/Groups/PDFGroup+Objects.swift
+++ b/Source/API/Groups/PDFGroup+Objects.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 31.05.19.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Groups/PDFGroup.swift b/Source/API/Groups/PDFGroup.swift
index 06a97405..1c39f38b 100644
--- a/Source/API/Groups/PDFGroup.swift
+++ b/Source/API/Groups/PDFGroup.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 31.05.19.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Groups/PDFMasterGroup.swift b/Source/API/Groups/PDFMasterGroup.swift
index 09221f5c..da4742a3 100644
--- a/Source/API/Groups/PDFMasterGroup.swift
+++ b/Source/API/Groups/PDFMasterGroup.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 31.05.19.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Image/PDFImage.swift b/Source/API/Image/PDFImage.swift
index 784aa894..17775767 100644
--- a/Source/API/Image/PDFImage.swift
+++ b/Source/API/Image/PDFImage.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 11/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Layout/PDFPageLayout.swift b/Source/API/Layout/PDFPageLayout.swift
index f5f2c194..11773861 100644
--- a/Source/API/Layout/PDFPageLayout.swift
+++ b/Source/API/Layout/PDFPageLayout.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 11/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/List/PDFList.swift b/Source/API/List/PDFList.swift
index bc6f0d88..f48551ce 100644
--- a/Source/API/List/PDFList.swift
+++ b/Source/API/List/PDFList.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 13/06/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Metadata/PDFInfo.swift b/Source/API/Metadata/PDFInfo.swift
index 3fac4a89..5f6fcf6b 100644
--- a/Source/API/Metadata/PDFInfo.swift
+++ b/Source/API/Metadata/PDFInfo.swift
@@ -5,7 +5,7 @@
// Created by Zheng-Xiang Ke on 2016/12/15.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/PDFGenerator+Generation.swift b/Source/API/PDFGenerator+Generation.swift
index fa9a03f9..74d2a585 100644
--- a/Source/API/PDFGenerator+Generation.swift
+++ b/Source/API/PDFGenerator+Generation.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 05/06/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
@@ -452,7 +452,7 @@ public extension PDFGenerator {
elements.append((styleIndex, textObj))
}
}
- let list = PDFList(indentations: styles.enumerated().map { (pre: CGFloat($0.offset + 1) * 10, past: 10) })
+ let list = PDFList(indentations: styles.indices.map { (pre: CGFloat($0 + 1) * 10, past: 10) })
var stack = Stack()
for (index, element) in elements {
let item = PDFListItem(symbol: symbol, content: element.simpleText?.text)
diff --git a/Source/API/PDFGenerator.swift b/Source/API/PDFGenerator.swift
index 29e3c442..bab29010 100644
--- a/Source/API/PDFGenerator.swift
+++ b/Source/API/PDFGenerator.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 11/08/16.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/PDFMultiDocumentGenerator.swift b/Source/API/PDFMultiDocumentGenerator.swift
index 77fc801b..a2bcaf54 100644
--- a/Source/API/PDFMultiDocumentGenerator.swift
+++ b/Source/API/PDFMultiDocumentGenerator.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 04.12.2019
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Page Format/PDFPageFormat+Layout.swift b/Source/API/Page Format/PDFPageFormat+Layout.swift
index 9ec6e403..bb83d476 100644
--- a/Source/API/Page Format/PDFPageFormat+Layout.swift
+++ b/Source/API/Page Format/PDFPageFormat+Layout.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 11/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Page Format/PDFPageFormat+NameConstants.swift b/Source/API/Page Format/PDFPageFormat+NameConstants.swift
index 918207fe..085f1dac 100644
--- a/Source/API/Page Format/PDFPageFormat+NameConstants.swift
+++ b/Source/API/Page Format/PDFPageFormat+NameConstants.swift
@@ -1,4 +1,4 @@
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Page Format/PDFPageFormat+SizeConstants.swift b/Source/API/Page Format/PDFPageFormat+SizeConstants.swift
index aeba6728..ed923e24 100644
--- a/Source/API/Page Format/PDFPageFormat+SizeConstants.swift
+++ b/Source/API/Page Format/PDFPageFormat+SizeConstants.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 11/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Page Format/PDFPageFormat.swift b/Source/API/Page Format/PDFPageFormat.swift
index 96aea0cb..7af5cd61 100644
--- a/Source/API/Page Format/PDFPageFormat.swift
+++ b/Source/API/Page Format/PDFPageFormat.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12/08/16.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Pagination/PDFPagination.swift b/Source/API/Pagination/PDFPagination.swift
index ce98328d..864db49c 100644
--- a/Source/API/Pagination/PDFPagination.swift
+++ b/Source/API/Pagination/PDFPagination.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 11/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Pagination/PDFPaginationStyle.swift b/Source/API/Pagination/PDFPaginationStyle.swift
index 4605ff09..8ab0c2d8 100644
--- a/Source/API/Pagination/PDFPaginationStyle.swift
+++ b/Source/API/Pagination/PDFPaginationStyle.swift
@@ -10,7 +10,8 @@ import Foundation
/**
* Use predefined pagination styles or create a custom one, using `.CustomNumberFormat` or `.CustomClosure`.
*
- * Enums using a template String as parameter will replace the first instance of `%@` with the index and the second one with the total amount of pages.
+ * Enums using a template String as parameter will replace the first instance of `%@` with the index
+ * and the second one with the total amount of pages.
*/
public enum PDFPaginationStyle {
/**
diff --git a/Source/API/Section/PDFSection.swift b/Source/API/Section/PDFSection.swift
index 4b7b2135..8f7d3b78 100644
--- a/Source/API/Section/PDFSection.swift
+++ b/Source/API/Section/PDFSection.swift
@@ -5,7 +5,7 @@
// Created by Marco Betschart on 05.05.18.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Section/PDFSectionColumn.swift b/Source/API/Section/PDFSectionColumn.swift
index f08ceb8e..1fdffccf 100644
--- a/Source/API/Section/PDFSectionColumn.swift
+++ b/Source/API/Section/PDFSectionColumn.swift
@@ -5,7 +5,7 @@
// Created by Marco Betschart on 05.05.18.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Table/Content/PDFTableContent.swift b/Source/API/Table/Content/PDFTableContent.swift
index afa9e378..83a2948d 100644
--- a/Source/API/Table/Content/PDFTableContent.swift
+++ b/Source/API/Table/Content/PDFTableContent.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 13/06/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Table/Content/UIImage+PDFTableContent.swift b/Source/API/Table/Content/UIImage+PDFTableContent.swift
index 358d0d06..20a1095e 100644
--- a/Source/API/Table/Content/UIImage+PDFTableContent.swift
+++ b/Source/API/Table/Content/UIImage+PDFTableContent.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 20.12.19.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Table/PDFTable.swift b/Source/API/Table/PDFTable.swift
index 56a19d67..3791d9c5 100644
--- a/Source/API/Table/PDFTable.swift
+++ b/Source/API/Table/PDFTable.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 13/06/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Table/Style/PDFTableCellStyle.swift b/Source/API/Table/Style/PDFTableCellStyle.swift
index ff351ad3..016d73cf 100644
--- a/Source/API/Table/Style/PDFTableCellStyle.swift
+++ b/Source/API/Table/Style/PDFTableCellStyle.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 11/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Table/Style/PDFTableStyle+Defaults.swift b/Source/API/Table/Style/PDFTableStyle+Defaults.swift
index 49b1c138..facf8658 100644
--- a/Source/API/Table/Style/PDFTableStyle+Defaults.swift
+++ b/Source/API/Table/Style/PDFTableStyle+Defaults.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 19/01/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Text/PDFAttributedText.swift b/Source/API/Text/PDFAttributedText.swift
index 213a0011..b0968b24 100644
--- a/Source/API/Text/PDFAttributedText.swift
+++ b/Source/API/Text/PDFAttributedText.swift
@@ -7,7 +7,7 @@
import Foundation
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Text/PDFSimpleText.swift b/Source/API/Text/PDFSimpleText.swift
index 17503b12..af4404ed 100644
--- a/Source/API/Text/PDFSimpleText.swift
+++ b/Source/API/Text/PDFSimpleText.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 31/10/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Text/PDFTextStyle.swift b/Source/API/Text/PDFTextStyle.swift
index 2a36abba..24171e7d 100644
--- a/Source/API/Text/PDFTextStyle.swift
+++ b/Source/API/Text/PDFTextStyle.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 28.05.19.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/API/Utils/CrossPlattformGraphics.swift b/Source/API/Utils/CrossPlattformGraphics.swift
index 632524b3..2890614b 100644
--- a/Source/API/Utils/CrossPlattformGraphics.swift
+++ b/Source/API/Utils/CrossPlattformGraphics.swift
@@ -6,7 +6,7 @@
// Created by Philip Niedertscheider on 19.05.20.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
/// Cross-plattform type for `UIColor` and `NSColor`
diff --git a/Source/API/Utils/PDFRenderObject.swift b/Source/API/Utils/PDFRenderObject.swift
index 393eefff..42d1346e 100644
--- a/Source/API/Utils/PDFRenderObject.swift
+++ b/Source/API/Utils/PDFRenderObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/External/PDFExternalPageObject.swift b/Source/Internal/External/PDFExternalPageObject.swift
index 3075f07e..2e1e898a 100644
--- a/Source/Internal/External/PDFExternalPageObject.swift
+++ b/Source/Internal/External/PDFExternalPageObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12.08.19.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Graphics/PDFContextGraphics.swift b/Source/Internal/Graphics/PDFContextGraphics.swift
index 2182674a..21d31ed2 100644
--- a/Source/Internal/Graphics/PDFContextGraphics.swift
+++ b/Source/Internal/Graphics/PDFContextGraphics.swift
@@ -32,7 +32,7 @@ enum PDFContextGraphics {
}
#if os(macOS)
return Image(cgImage: cgImage, size: size)
- #elseif os(iOS)
+ #elseif os(iOS) || os(visionOS)
return Image(cgImage: cgImage)
#endif
}
diff --git a/Source/Internal/Graphics/PDFGraphics.swift b/Source/Internal/Graphics/PDFGraphics.swift
index 847c8c2e..3a2269e3 100644
--- a/Source/Internal/Graphics/PDFGraphics.swift
+++ b/Source/Internal/Graphics/PDFGraphics.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 13/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
@@ -187,7 +187,7 @@ enum PDFGraphics {
let size = CGSize(width: floor(frame.width * resizeFactor),
height: floor(frame.height * resizeFactor))
- #if os(iOS)
+ #if os(iOS) || os(visionOS)
UIGraphicsBeginImageContext(size)
image.draw(in: CGRect(origin: .zero, size: size))
let finalImage = UIGraphicsGetImageFromCurrentImageContext()
@@ -215,7 +215,7 @@ enum PDFGraphics {
- Returns: Compressed image
*/
static func compress(image: Image, quality: CGFloat) -> Image {
- #if os(iOS)
+ #if os(iOS) || os(visionOS)
guard let data = image.jpegData(compressionQuality: quality) else {
return image
}
@@ -256,7 +256,7 @@ enum PDFGraphics {
let clipPath = BezierPath(roundedRect: CGRect(origin: .zero, size: size), byRoundingCorners: corners, cornerRadii: cornerRadii)
- #if os(iOS)
+ #if os(iOS) || os(visionOS)
UIGraphicsBeginImageContext(size)
#elseif os(macOS)
let finalImage = NSImage(size: size)
@@ -266,7 +266,7 @@ enum PDFGraphics {
clipPath.addClip()
image.draw(in: CGRect(origin: .zero, size: size))
- #if os(iOS)
+ #if os(iOS) || os(visionOS)
let finalImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return finalImage ?? image
@@ -291,7 +291,7 @@ enum PDFGraphics {
case let .dotted(foreColor, backColor):
let size = CGSize(width: 5, height: 5)
- #if os(iOS)
+ #if os(iOS) || os(visionOS)
UIGraphicsBeginImageContext(size)
#elseif os(macOS)
let image = NSImage(size: size)
@@ -307,7 +307,7 @@ enum PDFGraphics {
path = BezierPath(ovalIn: CGRect(x: 2.5, y: 2.5, width: 2.5, height: 2.5))
path.fill()
- #if os(iOS)
+ #if os(iOS) || os(visionOS)
let image = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
#elseif os(macOS)
diff --git a/Source/Internal/Graphics/PDFLineObject.swift b/Source/Internal/Graphics/PDFLineObject.swift
index e2c9c0ac..5694e044 100644
--- a/Source/Internal/Graphics/PDFLineObject.swift
+++ b/Source/Internal/Graphics/PDFLineObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 06.12.17.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Graphics/PDFLineSeparatorObject.swift b/Source/Internal/Graphics/PDFLineSeparatorObject.swift
index 1df57f22..81c7432b 100644
--- a/Source/Internal/Graphics/PDFLineSeparatorObject.swift
+++ b/Source/Internal/Graphics/PDFLineSeparatorObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Graphics/PDFRectangleObject.swift b/Source/Internal/Graphics/PDFRectangleObject.swift
index 7ebed30d..532d7b57 100644
--- a/Source/Internal/Graphics/PDFRectangleObject.swift
+++ b/Source/Internal/Graphics/PDFRectangleObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 06.12.17.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Graphics/UIColor+CloseToEqual.swift b/Source/Internal/Graphics/UIColor+CloseToEqual.swift
index cd51f276..d7395aef 100644
--- a/Source/Internal/Graphics/UIColor+CloseToEqual.swift
+++ b/Source/Internal/Graphics/UIColor+CloseToEqual.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 16/11/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Group/PDFGroupObject.swift b/Source/Internal/Group/PDFGroupObject.swift
index dfcaef98..498f21ab 100644
--- a/Source/Internal/Group/PDFGroupObject.swift
+++ b/Source/Internal/Group/PDFGroupObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 31.05.19.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
@@ -187,7 +187,7 @@ class PDFGroupObject: PDFRenderObject {
)
let cgImage: CGImage?
- #if os(iOS)
+ #if os(iOS) || os(visionOS)
cgImage = modifiedImage.cgImage
#elseif os(macOS)
cgImage = modifiedImage.cgImage(forProposedRect: nil, context: nil, hints: nil)
diff --git a/Source/Internal/Image/PDFImageObject.swift b/Source/Internal/Image/PDFImageObject.swift
index 7226bf37..3c9b212e 100644
--- a/Source/Internal/Image/PDFImageObject.swift
+++ b/Source/Internal/Image/PDFImageObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
@@ -122,7 +122,7 @@ class PDFImageObject: PDFRenderObject {
cornerRadius: image.cornerRadius)
let cgImage: CGImage?
- #if os(iOS)
+ #if os(iOS) || os(visionOS)
cgImage = modifiedImage.cgImage
#elseif os(macOS)
cgImage = modifiedImage.cgImage(forProposedRect: nil, context: nil, hints: nil)
diff --git a/Source/Internal/Image/PDFImageRowObject.swift b/Source/Internal/Image/PDFImageRowObject.swift
index 3481bc77..40818f5c 100644
--- a/Source/Internal/Image/PDFImageRowObject.swift
+++ b/Source/Internal/Image/PDFImageRowObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Layout/PDFColumnLayoutState.swift b/Source/Internal/Layout/PDFColumnLayoutState.swift
index fc91b57f..40878a8f 100644
--- a/Source/Internal/Layout/PDFColumnLayoutState.swift
+++ b/Source/Internal/Layout/PDFColumnLayoutState.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 30.05.19.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Layout/PDFIndentationObject.swift b/Source/Internal/Layout/PDFIndentationObject.swift
index eea674ee..7c563ef5 100644
--- a/Source/Internal/Layout/PDFIndentationObject.swift
+++ b/Source/Internal/Layout/PDFIndentationObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Layout/PDFLayout.swift b/Source/Internal/Layout/PDFLayout.swift
index dbb9dc20..fe256827 100644
--- a/Source/Internal/Layout/PDFLayout.swift
+++ b/Source/Internal/Layout/PDFLayout.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 31/10/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Layout/PDFLayoutHeights.swift b/Source/Internal/Layout/PDFLayoutHeights.swift
index adea90ef..9a9b939f 100644
--- a/Source/Internal/Layout/PDFLayoutHeights.swift
+++ b/Source/Internal/Layout/PDFLayoutHeights.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 30/10/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Layout/PDFLayoutIndentations.swift b/Source/Internal/Layout/PDFLayoutIndentations.swift
index 89f47873..01ecf169 100644
--- a/Source/Internal/Layout/PDFLayoutIndentations.swift
+++ b/Source/Internal/Layout/PDFLayoutIndentations.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 30/10/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Layout/PDFMarginObject.swift b/Source/Internal/Layout/PDFMarginObject.swift
index fb45b0d9..71162c1b 100644
--- a/Source/Internal/Layout/PDFMarginObject.swift
+++ b/Source/Internal/Layout/PDFMarginObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 31.05.19.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Layout/PDFOffsetObject.swift b/Source/Internal/Layout/PDFOffsetObject.swift
index 5673985e..8fff8b68 100644
--- a/Source/Internal/Layout/PDFOffsetObject.swift
+++ b/Source/Internal/Layout/PDFOffsetObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Layout/PDFPageBreakObject.swift b/Source/Internal/Layout/PDFPageBreakObject.swift
index 1ecd24f1..8885bcab 100644
--- a/Source/Internal/Layout/PDFPageBreakObject.swift
+++ b/Source/Internal/Layout/PDFPageBreakObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Layout/PDFSpaceObject.swift b/Source/Internal/Layout/PDFSpaceObject.swift
index e6e2852e..71166715 100644
--- a/Source/Internal/Layout/PDFSpaceObject.swift
+++ b/Source/Internal/Layout/PDFSpaceObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Math/CGPoint+Math.swift b/Source/Internal/Math/CGPoint+Math.swift
index 055fc765..e56d84eb 100644
--- a/Source/Internal/Math/CGPoint+Math.swift
+++ b/Source/Internal/Math/CGPoint+Math.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 04/11/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Math/CGPoint+Null.swift b/Source/Internal/Math/CGPoint+Null.swift
index 77f3d8e8..a69e45df 100644
--- a/Source/Internal/Math/CGPoint+Null.swift
+++ b/Source/Internal/Math/CGPoint+Null.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 06.01.20.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/PDFGenerator+Debug.swift b/Source/Internal/PDFGenerator+Debug.swift
index 8c59f572..888a4bb9 100644
--- a/Source/Internal/PDFGenerator+Debug.swift
+++ b/Source/Internal/PDFGenerator+Debug.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 24/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/PDFGenerator+Layout.swift b/Source/Internal/PDFGenerator+Layout.swift
index 925daa16..5054967b 100644
--- a/Source/Internal/PDFGenerator+Layout.swift
+++ b/Source/Internal/PDFGenerator+Layout.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 13/06/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Section/PDFColumnWrapSectionObject.swift b/Source/Internal/Section/PDFColumnWrapSectionObject.swift
index df6bddda..a05a57b7 100644
--- a/Source/Internal/Section/PDFColumnWrapSectionObject.swift
+++ b/Source/Internal/Section/PDFColumnWrapSectionObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 28.05.19.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Section/PDFSectionObject.swift b/Source/Internal/Section/PDFSectionObject.swift
index 9ef56d47..7a842b95 100644
--- a/Source/Internal/Section/PDFSectionObject.swift
+++ b/Source/Internal/Section/PDFSectionObject.swift
@@ -5,7 +5,7 @@
// Created by Marco Betschart on 05.05.18.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Table/PDFTableObject.swift b/Source/Internal/Table/PDFTableObject.swift
index 4d631d7f..5389e41f 100644
--- a/Source/Internal/Table/PDFTableObject.swift
+++ b/Source/Internal/Table/PDFTableObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Table/PDFTableValidator.swift b/Source/Internal/Table/PDFTableValidator.swift
index 50eb0e43..4b8f7bf1 100644
--- a/Source/Internal/Table/PDFTableValidator.swift
+++ b/Source/Internal/Table/PDFTableValidator.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 11/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Text/PDFAttributedTextObject.swift b/Source/Internal/Text/PDFAttributedTextObject.swift
index fbedf147..580c1cd8 100644
--- a/Source/Internal/Text/PDFAttributedTextObject.swift
+++ b/Source/Internal/Text/PDFAttributedTextObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Text/PDFFontObject.swift b/Source/Internal/Text/PDFFontObject.swift
index 845d1858..680d0b87 100644
--- a/Source/Internal/Text/PDFFontObject.swift
+++ b/Source/Internal/Text/PDFFontObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Text/PDFTextColorObject.swift b/Source/Internal/Text/PDFTextColorObject.swift
index b5012d30..8c2aebd3 100644
--- a/Source/Internal/Text/PDFTextColorObject.swift
+++ b/Source/Internal/Text/PDFTextColorObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 12/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Utils/PDFCalculations.swift b/Source/Internal/Utils/PDFCalculations.swift
index 70dfdebb..8a09d1a3 100644
--- a/Source/Internal/Utils/PDFCalculations.swift
+++ b/Source/Internal/Utils/PDFCalculations.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 24/08/2017.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Source/Internal/Utils/PDFSlicedObject.swift b/Source/Internal/Utils/PDFSlicedObject.swift
index 4cf0c0c4..cb21222d 100644
--- a/Source/Internal/Utils/PDFSlicedObject.swift
+++ b/Source/Internal/Utils/PDFSlicedObject.swift
@@ -5,7 +5,7 @@
// Created by Philip Niedertscheider on 06.01.20.
//
-#if os(iOS)
+#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
diff --git a/Tests/TPPDFTests/Internal/Table/PDFTableObjectSpec.swift b/Tests/TPPDFTests/Internal/Table/PDFTableObjectSpec.swift
index 9261d087..d7905e9e 100644
--- a/Tests/TPPDFTests/Internal/Table/PDFTableObjectSpec.swift
+++ b/Tests/TPPDFTests/Internal/Table/PDFTableObjectSpec.swift
@@ -5,7 +5,7 @@ import Quick
@testable import TPPDF
import XCTest
-#if os(iOS)
+#if os(iOS) || os(visionOS)
class PDFTableObjectSpec: XCTestCase {
/// Preconditions:
/// - Multiple pages