Skip to content

Commit

Permalink
Drop support for iOS 15 (#1056)
Browse files Browse the repository at this point in the history
Update PSPDFKit/PSPDFKit-SP to 14.3.0
Remove unnecessary code
  • Loading branch information
mvasilak authored Jan 15, 2025
1 parent f3eddec commit 5928649
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 60 deletions.
26 changes: 13 additions & 13 deletions Zotero.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6127,7 +6127,7 @@
);
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
INFOPLIST_FILE = Zotero/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -6164,7 +6164,7 @@
);
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
INFOPLIST_FILE = Zotero/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -6197,7 +6197,7 @@
"TESTING=1",
);
INFOPLIST_FILE = ZoteroTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -6223,7 +6223,7 @@
COPY_PHASE_STRIP = YES;
DEVELOPMENT_TEAM = 8LAYR367YV;
INFOPLIST_FILE = ZoteroTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -6248,7 +6248,7 @@
COPY_PHASE_STRIP = YES;
DEVELOPMENT_TEAM = 8LAYR367YV;
INFOPLIST_FILE = ZoteroUITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -6273,7 +6273,7 @@
COPY_PHASE_STRIP = YES;
DEVELOPMENT_TEAM = 8LAYR367YV;
INFOPLIST_FILE = ZoteroUITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -6304,7 +6304,7 @@
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = ZShare/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -6338,7 +6338,7 @@
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = ZShare/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -6440,7 +6440,7 @@
);
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
INFOPLIST_FILE = Zotero/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -6474,7 +6474,7 @@
"TESTING=1",
);
INFOPLIST_FILE = ZoteroTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -6499,7 +6499,7 @@
COPY_PHASE_STRIP = YES;
DEVELOPMENT_TEAM = 8LAYR367YV;
INFOPLIST_FILE = ZoteroUITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -6530,7 +6530,7 @@
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = ZShare/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -6714,7 +6714,7 @@
repositoryURL = "https://github.com/PSPDFKit/PSPDFKit-SP";
requirement = {
kind = exactVersion;
version = 14.1.1;
version = 14.3.0;
};
};
B3D84BEE27919FDE005DDD7C /* XCRemoteSwiftPackageReference "Starscream" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/PSPDFKit/PSPDFKit-SP",
"state" : {
"revision" : "80539b4cf5f06bc987b1ceae49b42959f256896b",
"version" : "14.1.1"
"revision" : "ef3a12718e273fe0b0fee1cf664b6de077d66a69",
"version" : "14.3.0"
}
},
{
Expand Down
6 changes: 1 addition & 5 deletions Zotero/Scenes/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -819,11 +819,7 @@ extension AppCoordinator: ConflictReceiver {
domainName = "zotero.org"
} else {
let url = URL(string: webDavController.sessionStorage.url)
if #available(iOS 16.0, *) {
domainName = url?.host() ?? ""
} else {
domainName = url?.host ?? ""
}
domainName = url?.host() ?? ""
}

let actions = [UIAlertAction(title: L10n.Errors.Sync.resetGroupFiles, style: .cancel, handler: { _ in
Expand Down
13 changes: 0 additions & 13 deletions Zotero/Scenes/Detail/PDF/PDFCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ protocol PdfReaderCoordinatorDelegate: AnyObject {
func show(error: PDFDocumentExporter.Error)
func share(url: URL, barButton: UIBarButtonItem)
func share(text: String, rect: CGRect, view: UIView, userInterfaceStyle: UIUserInterfaceStyle)
func lookup(text: String, rect: CGRect, view: UIView, userInterfaceStyle: UIUserInterfaceStyle)
func showDeletedAlertForPdf(completion: @escaping (Bool) -> Void)
func showSettings(with settings: PDFSettings, sender: UIBarButtonItem) -> ViewModel<ReaderSettingsActionHandler>
func showReader(document: Document, userInterfaceStyle: UIUserInterfaceStyle)
Expand Down Expand Up @@ -304,18 +303,6 @@ extension PDFCoordinator: PdfReaderCoordinatorDelegate {
self.share(item: text, sourceView: .view(view, rect), userInterfaceStyle: userInterfaceStyle)
}

func lookup(text: String, rect: CGRect, view: UIView, userInterfaceStyle: UIUserInterfaceStyle) {
DDLogInfo("PDFCoordinator: show lookup")
// When presented as a popover, UIReferenceLibraryViewController ignores overrideUserInterfaceStyle, so we wrap it in a navigation controller to force it.
let controller = UINavigationController(rootViewController: UIReferenceLibraryViewController(term: text))
controller.setNavigationBarHidden(true, animated: false)
controller.overrideUserInterfaceStyle = userInterfaceStyle
controller.modalPresentationStyle = .popover
controller.popoverPresentationController?.sourceView = view
controller.popoverPresentationController?.sourceRect = rect
self.navigationController?.present(controller, animated: true, completion: nil)
}

func show(error: PDFReaderState.Error) {
let title: String
let message: String
Expand Down
14 changes: 0 additions & 14 deletions Zotero/Scenes/Detail/PDF/Views/PDFDocumentViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -782,9 +782,6 @@ extension PDFDocumentViewController: PDFViewControllerDelegate {
return action
}

case .PSPDFKit.accessibility:
return action

case .share:
guard action.identifier == .PSPDFKit.share else { return nil }
return action.replacing(handler: { [weak self] _ in
Expand All @@ -799,17 +796,6 @@ extension PDFDocumentViewController: PDFViewControllerDelegate {

case .pspdfkitActions:
switch action.identifier {
case .PSPDFKit.define:
return action.replacing(title: L10n.lookUp, handler: { [weak self] _ in
guard let self else { return }
coordinatorDelegate?.lookup(
text: glyphs.text,
rect: pageView.convert(glyphs.boundingBox, from: pageView.pdfCoordinateSpace),
view: pageView,
userInterfaceStyle: viewModel.state.settings.appearanceMode.userInterfaceStyle
)
})

case .PSPDFKit.searchDocument:
return action.replacing(handler: { [weak self] _ in
guard let self, let pdfController else { return }
Expand Down
3 changes: 0 additions & 3 deletions Zotero/Scenes/Detail/PDF/Views/PDFReaderViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,6 @@ class PDFReaderViewController: UIViewController {
}

override func viewIsAppearing(_ animated: Bool) {
if #unavailable(iOS 16.0) {
children.forEach { $0.viewIsAppearing(animated) }
}
super.viewIsAppearing(animated)
let editingEnabled = viewModel.state.library.metadataEditable && !viewModel.state.document.isLocked
annotationToolbarHandler.viewIsAppearing(editingEnabled: editingEnabled)
Expand Down
7 changes: 0 additions & 7 deletions Zotero/Scenes/Detail/PDF/Views/PDFSidebarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,6 @@ class PDFSidebarViewController: UIViewController {
select(tab: .annotations)
}

override func viewIsAppearing(_ animated: Bool) {
if #unavailable(iOS 16.0) {
children.forEach { $0.viewIsAppearing(animated) }
}
super.viewIsAppearing(animated)
}

private func select(tab: Tab) {
guard let index = Tab.sortedTabs.firstIndex(of: tab) else { return }
picker.selectedSegmentIndex = index
Expand Down
4 changes: 1 addition & 3 deletions Zotero/Scenes/General/Views/TagPickerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ final class TagPickerViewController: UIViewController {
.disposed(by: self.disposeBag)

self.navigationItem.searchController = searchController
if #available(iOS 16.0, *) {
self.navigationItem.preferredSearchBarPlacement = .stacked
}
self.navigationItem.preferredSearchBarPlacement = .stacked
self.navigationItem.hidesSearchBarWhenScrolling = false
}

Expand Down

0 comments on commit 5928649

Please sign in to comment.