Skip to content
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

Update dependencies #789

Merged
merged 4 commits into from
Oct 23, 2023
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
13 changes: 7 additions & 6 deletions ZShare/ViewModels/ExtensionViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Combine
import Foundation
import MobileCoreServices
import WebKit
import UniformTypeIdentifiers

import Alamofire
import CocoaLumberjackSwift
Expand Down Expand Up @@ -377,13 +378,13 @@ final class ExtensionViewModel {
}

private func loadProviderData(from itemProvider: NSItemProvider) -> Observable<Result<State.RawAttachment, State.AttachmentState.Error>> {
if itemProvider.hasItemConformingToTypeIdentifier(kUTTypePropertyList as String) {
if itemProvider.hasItemConformingToTypeIdentifier(UTType.propertyList.identifier) {
DDLogInfo("ExtensionViewModel: item provider for property list")
return self.loadWebData(from: itemProvider)
} else if itemProvider.hasItemConformingToTypeIdentifier(kUTTypeURL as String) {
} else if itemProvider.hasItemConformingToTypeIdentifier(UTType.url.identifier) {
DDLogInfo("ExtensionViewModel: item provider for URL")
return self.loadUrl(from: itemProvider)
} else if itemProvider.hasItemConformingToTypeIdentifier(kUTTypePlainText as String) {
} else if itemProvider.hasItemConformingToTypeIdentifier(UTType.plainText.identifier) {
DDLogInfo("ExtensionViewModel: item provider for plain text")
return self.loadPlainText(from: itemProvider)
}
Expand Down Expand Up @@ -498,7 +499,7 @@ final class ExtensionViewModel {

DDLogInfo("ExtensionViewModel: load item provider")

itemProvider.loadItem(forTypeIdentifier: (kUTTypeURL as String), options: nil, completionHandler: { item, error -> Void in
itemProvider.loadItem(forTypeIdentifier: (UTType.url.identifier), options: nil, completionHandler: { item, error -> Void in
DDLogInfo("ExtensionViewModel: loaded item provider")
if let error = error {
DDLogError("ExtensionViewModel: url load error - \(error)")
Expand Down Expand Up @@ -533,7 +534,7 @@ final class ExtensionViewModel {

DDLogInfo("ExtensionViewModel: load item provider")

itemProvider.loadItem(forTypeIdentifier: (kUTTypePropertyList as String), options: nil, completionHandler: { item, error -> Void in
itemProvider.loadItem(forTypeIdentifier: (UTType.propertyList.identifier), options: nil, completionHandler: { item, error -> Void in
DDLogInfo("ExtensionViewModel: loaded item provider")
if let error = error {
DDLogError("ExtensionViewModel: web data load error - \(error)")
Expand Down Expand Up @@ -583,7 +584,7 @@ final class ExtensionViewModel {

DDLogInfo("ExtensionViewModel: load item provider")

itemProvider.loadItem(forTypeIdentifier: (kUTTypePlainText as String), options: nil, completionHandler: { item, error -> Void in
itemProvider.loadItem(forTypeIdentifier: (UTType.plainText.identifier), options: nil, completionHandler: { item, error -> Void in
DDLogInfo("ExtensionViewModel: loaded item provider")
if let error = error {
DDLogError("ExtensionViewModel: url plaintext error - \(error)")
Expand Down
32 changes: 14 additions & 18 deletions Zotero.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,6 @@
B3830CEA255451DC00910FE0 /* TagPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3830CE8255451DC00910FE0 /* TagPickerViewController.swift */; };
B3830CF625545EE400910FE0 /* TagPickerCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3830CF425545EE400910FE0 /* TagPickerCell.swift */; };
B3830CF725545EE400910FE0 /* TagPickerCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B3830CF525545EE400910FE0 /* TagPickerCell.xib */; };
B3841080281AC752006751B0 /* UITableViewDiffableDataSource+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B384107F281AC752006751B0 /* UITableViewDiffableDataSource+Extensions.swift */; };
B385B70E25C03E7E0073CA6F /* PDFExportState.swift in Sources */ = {isa = PBXBuildFile; fileRef = B385B70D25C03E7E0073CA6F /* PDFExportState.swift */; };
B386328626C5499900183062 /* TranslatorsAndStylesController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B36A988C2428E059005D5790 /* TranslatorsAndStylesController.swift */; };
B3863FC82AD819AB005082F0 /* EndItemDetailEditingDbRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3863FC72AD819AB005082F0 /* EndItemDetailEditingDbRequest.swift */; };
Expand Down Expand Up @@ -1720,7 +1719,6 @@
B3830CE8255451DC00910FE0 /* TagPickerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TagPickerViewController.swift; sourceTree = "<group>"; };
B3830CF425545EE400910FE0 /* TagPickerCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagPickerCell.swift; sourceTree = "<group>"; };
B3830CF525545EE400910FE0 /* TagPickerCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TagPickerCell.xib; sourceTree = "<group>"; };
B384107F281AC752006751B0 /* UITableViewDiffableDataSource+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITableViewDiffableDataSource+Extensions.swift"; sourceTree = "<group>"; };
B385B70D25C03E7E0073CA6F /* PDFExportState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PDFExportState.swift; sourceTree = "<group>"; };
B3863FC72AD819AB005082F0 /* EndItemDetailEditingDbRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EndItemDetailEditingDbRequest.swift; sourceTree = "<group>"; };
B3863FC92AD830DE005082F0 /* DeleteCreatorItemDetailDbRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteCreatorItemDetailDbRequest.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2433,7 +2431,6 @@
B3593ADB24B60A7600CA0B57 /* UISearchBar+Extensions.swift */,
B36C07DD26FB264800C855A9 /* UITableView+Extensions.swift */,
B3B953D12459B4D800FC96DB /* UITableViewCell+SwiftUI.swift */,
B384107F281AC752006751B0 /* UITableViewDiffableDataSource+Extensions.swift */,
B305651223FC051E003304F2 /* UIView+Extensions.swift */,
B305650E23FC051E003304F2 /* UIViewController+Extensions.swift */,
B340831228F983CF0087D1A1 /* URL+Extensions.swift */,
Expand Down Expand Up @@ -4821,7 +4818,6 @@
B305660A23FC051E003304F2 /* RegisterUploadRequest.swift in Sources */,
B31CC57F28646D8E0055C114 /* ManualLookupAction.swift in Sources */,
B3E8FE582714323200F51458 /* SavingSettingsAction.swift in Sources */,
B3841080281AC752006751B0 /* UITableViewDiffableDataSource+Extensions.swift in Sources */,
B3ADBCB827CFB64B00B7041F /* PDFSettingsViewController.swift in Sources */,
B305662B23FC051F003304F2 /* SyncProgressHandler.swift in Sources */,
B3F09AE629CAFF860084E4D8 /* TagFilterActionHandler.swift in Sources */,
Expand Down Expand Up @@ -5628,7 +5624,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.7;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -5686,7 +5682,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.7;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -5717,7 +5713,7 @@
);
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
INFOPLIST_FILE = Zotero/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.7;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -5754,7 +5750,7 @@
);
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
INFOPLIST_FILE = Zotero/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.7;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -5787,7 +5783,7 @@
"TESTING=1",
);
INFOPLIST_FILE = ZoteroTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.7;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -5814,7 +5810,7 @@
COPY_PHASE_STRIP = YES;
DEVELOPMENT_TEAM = 8LAYR367YV;
INFOPLIST_FILE = ZoteroTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.7;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -5840,7 +5836,7 @@
COPY_PHASE_STRIP = YES;
DEVELOPMENT_TEAM = 8LAYR367YV;
INFOPLIST_FILE = ZoteroUITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.7;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -5866,7 +5862,7 @@
COPY_PHASE_STRIP = YES;
DEVELOPMENT_TEAM = 8LAYR367YV;
INFOPLIST_FILE = ZoteroUITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.7;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -5896,7 +5892,7 @@
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = ZShare/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.7;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -5927,7 +5923,7 @@
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = ZShare/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.7;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -6024,7 +6020,7 @@
repositoryURL = "https://github.com/RxSwiftCommunity/RxSwiftExt";
requirement = {
kind = exactVersion;
version = 6.2.0;
version = 6.2.1;
};
};
B356A3792524A63D003F1943 /* XCRemoteSwiftPackageReference "SwiftyGif" */ = {
Expand All @@ -6040,7 +6036,7 @@
repositoryURL = "https://github.com/weichsel/ZIPFoundation";
requirement = {
kind = exactVersion;
version = 0.9.16;
version = 0.9.17;
};
};
B356A3882524A698003F1943 /* XCRemoteSwiftPackageReference "Nimble" */ = {
Expand Down Expand Up @@ -6080,7 +6076,7 @@
repositoryURL = "https://github.com/realm/realm-cocoa";
requirement = {
kind = exactVersion;
version = 10.42.2;
version = 10.43.1;
};
};
B35E4B8B25248B3C000EA134 /* XCRemoteSwiftPackageReference "RxSwift" */ = {
Expand All @@ -6096,7 +6092,7 @@
repositoryURL = "https://github.com/PSPDFKit/PSPDFKit-SP";
requirement = {
kind = exactVersion;
version = 12.3.1;
version = 13.0.1;
};
};
B3D84BEE27919FDE005DDD7C /* XCRemoteSwiftPackageReference "Starscream" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/PSPDFKit/PSPDFKit-SP",
"state" : {
"revision" : "33f91d1c5cac1a68876582bf05b561a9155a410c",
"version" : "12.3.1"
"revision" : "324c9a623e879e7a1ff8aa8e1968739619ae538d",
"version" : "13.0.1"
}
},
{
Expand All @@ -95,17 +95,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-cocoa",
"state" : {
"revision" : "2ce1ef9a5d48d34470bfd21d3b722fa9c05c0b4e",
"version" : "10.42.2"
"revision" : "a3da8c91ee44c7610d4b1100bd3079ddca26ab84",
"version" : "10.43.1"
}
},
{
"identity" : "realm-core",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-core",
"state" : {
"revision" : "1eb93c9619f6a05b5a91c2719690606016802e0b",
"version" : "13.20.1"
"revision" : "c569bec4d04da84030d94f376437bc4efda3686b",
"version" : "13.23.1"
}
},
{
Expand All @@ -122,8 +122,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/RxSwiftCommunity/RxSwiftExt",
"state" : {
"revision" : "a8065d19acbdee55c6e2b2d9a17a420e34ab8d83",
"version" : "6.2.0"
"revision" : "eb4adf9f00a21b3efc3869a5218a6d7517e95222",
"version" : "6.2.1"
}
},
{
Expand Down Expand Up @@ -158,8 +158,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/weichsel/ZIPFoundation",
"state" : {
"revision" : "43ec568034b3731101dbf7670765d671c30f54f3",
"version" : "0.9.16"
"revision" : "a3f5c2bae0f04b0bce9ef3c4ba6bd1031a0564c4",
"version" : "0.9.17"
}
}
],
Expand Down
13 changes: 3 additions & 10 deletions Zotero/Extensions/String+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@

import Foundation
import CoreServices
import UniformTypeIdentifiers

extension String {
var mimeTypeFromExtension: String? {
if let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, self as NSString, nil)?.takeRetainedValue() {
if let mimetype = UTTypeCopyPreferredTagWithClass(uti, kUTTagClassMIMEType)?.takeRetainedValue() {
return mimetype as String
}
}
return nil
UTType(tag: self, tagClass: .filenameExtension, conformingTo: nil)?.preferredMIMEType
}

var extensionFromMimeType: String? {
Expand All @@ -36,10 +32,7 @@ extension String {
default: break
}

guard let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, self as CFString, nil),
let ext = UTTypeCopyPreferredTagWithClass(uti.takeRetainedValue(), kUTTagClassFilenameExtension)
else { return nil }
return ext.takeRetainedValue() as String
return UTType(tag: self, tagClass: .mimeType, conformingTo: nil)?.preferredFilenameExtension
}

var strippedHtmlTags: String {
Expand Down
5 changes: 3 additions & 2 deletions Zotero/Extensions/UIPasteboard+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import MobileCoreServices
import UIKit
import UniformTypeIdentifiers

import CocoaLumberjackSwift

Expand All @@ -19,12 +20,12 @@ extension UIPasteboard {
return
}

var item: [String: Any] = [(kUTTypePlainText as String): plaintext, (kUTTypeHTML as String): htmlData]
var item: [String: Any] = [UTType.plainText.identifier: plaintext, UTType.html.identifier: htmlData]

do {
let attrString = try NSAttributedString(data: htmlData, options: [.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil)
let data = try attrString.data(from: NSRange(location: 0, length: attrString.length), documentAttributes: [.documentType: NSAttributedString.DocumentType.rtf])
item[kUTTypeRTF as String] = data
item[UTType.rtf.identifier] = data
} catch let error {
DDLogError("UIPasteboard: can't convert html to attributed string or rtf - \(error)")
}
Expand Down
61 changes: 0 additions & 61 deletions Zotero/Extensions/UITableViewDiffableDataSource+Extensions.swift

This file was deleted.

4 changes: 2 additions & 2 deletions Zotero/Models/StringAttributes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ enum StringAttribute: CaseIterable {

case .smallcaps:
descriptorAttributes[.featureSettings] = [
[UIFontDescriptor.FeatureKey.featureIdentifier: kLowerCaseType, UIFontDescriptor.FeatureKey.typeIdentifier: kLowerCaseSmallCapsSelector],
[UIFontDescriptor.FeatureKey.featureIdentifier: kUpperCaseType, UIFontDescriptor.FeatureKey.typeIdentifier: kUpperCaseSmallCapsSelector]
[UIFontDescriptor.FeatureKey.type: kLowerCaseType, UIFontDescriptor.FeatureKey.selector: kLowerCaseSmallCapsSelector],
[UIFontDescriptor.FeatureKey.type: kUpperCaseType, UIFontDescriptor.FeatureKey.selector: kUpperCaseSmallCapsSelector]
]
}
}
Expand Down
Loading
Loading