From 6df404259f3a7327284726d36f5d6bc0df7671d3 Mon Sep 17 00:00:00 2001 From: Tarik Uygun Date: Sat, 9 Mar 2024 13:09:12 +0300 Subject: [PATCH 1/6] Add missing resources --- TraktKit.xcodeproj/project.pbxproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/TraktKit.xcodeproj/project.pbxproj b/TraktKit.xcodeproj/project.pbxproj index 5fcc08a..0050524 100644 --- a/TraktKit.xcodeproj/project.pbxproj +++ b/TraktKit.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 269487002B9C6B6D00455FAA /* UserResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 269486FF2B9C6B6D00455FAA /* UserResource.swift */; }; + 269487022B9C6BAC00455FAA /* SearchResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 269487012B9C6BAC00455FAA /* SearchResource.swift */; }; 70005646206BBD30005319DD /* test_get_users_watching_now.json in Resources */ = {isa = PBXBuildFile; fileRef = 70005645206BBD30005319DD /* test_get_users_watching_now.json */; }; 70005648206BBF47005319DD /* TraktEpisodeTranslation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70005647206BBF47005319DD /* TraktEpisodeTranslation.swift */; }; 7000564C206BC209005319DD /* test_get_all_episode_translations.json in Resources */ = {isa = PBXBuildFile; fileRef = 7000564B206BC209005319DD /* test_get_all_episode_translations.json */; }; @@ -302,6 +304,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 269486FF2B9C6B6D00455FAA /* UserResource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserResource.swift; sourceTree = ""; }; + 269487012B9C6BAC00455FAA /* SearchResource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchResource.swift; sourceTree = ""; }; 70005645206BBD30005319DD /* test_get_users_watching_now.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = test_get_users_watching_now.json; sourceTree = ""; }; 70005647206BBF47005319DD /* TraktEpisodeTranslation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TraktEpisodeTranslation.swift; sourceTree = ""; }; 7000564B206BC209005319DD /* test_get_all_episode_translations.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = test_get_all_episode_translations.json; sourceTree = ""; }; @@ -1108,6 +1112,7 @@ 74A88269267772220075491B /* Resources */ = { isa = PBXGroup; children = ( + 269487012B9C6BAC00455FAA /* SearchResource.swift */, 74A8827E267772B10075491B /* TraktManager+AsyncAwait.swift */, 74A8827A267772A30075491B /* TraktManager+Resources.swift */, 74A8826A267772360075491B /* ShowResource.swift */, @@ -1115,6 +1120,7 @@ 74A88272267772490075491B /* EpisodeResource.swift */, 74A882762677724E0075491B /* MovieResource.swift */, 74A8828226777C770075491B /* ExploreResource.swift */, + 269486FF2B9C6B6D00455FAA /* UserResource.swift */, ); path = Resources; sourceTree = ""; @@ -1525,6 +1531,7 @@ 70F773301F3C77D80078110E /* Alias.swift in Sources */, 703D2ED71EF1422300CAD268 /* Person.swift in Sources */, 700FED291F3FBD8C00169961 /* ScrobbleResult.swift in Sources */, + 269487002B9C6B6D00455FAA /* UserResource.swift in Sources */, 70B8442E1EF0DC4D001BA900 /* TraktWatchedProgress.swift in Sources */, 70D369932066DE000008B9D7 /* TraktCommentLikedUser.swift in Sources */, 70B844251EF0DC4D001BA900 /* TraktMostShow.swift in Sources */, @@ -1545,6 +1552,7 @@ 74A8828326777C770075491B /* ExploreResource.swift in Sources */, 70F7E6231EF220160026B8A1 /* CalendarShow.swift in Sources */, 705462671EF367BA003BB24B /* PlaybackProgress.swift in Sources */, + 269487022B9C6BAC00455FAA /* SearchResource.swift in Sources */, 70393F381F3F2C4700943D34 /* RemoveRatingsResult.swift in Sources */, 74A882772677724E0075491B /* MovieResource.swift in Sources */, 70B8443E1EF0E020001BA900 /* TraktCheckin.swift in Sources */, From 24876702af825fb2ec38c78ca350854dbfcdf571 Mon Sep 17 00:00:00 2001 From: Tarik Uygun Date: Sat, 9 Mar 2024 13:09:41 +0300 Subject: [PATCH 2/6] Update deployment target to 13.0 --- TraktKit.xcodeproj/project.pbxproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TraktKit.xcodeproj/project.pbxproj b/TraktKit.xcodeproj/project.pbxproj index 0050524..276f81d 100644 --- a/TraktKit.xcodeproj/project.pbxproj +++ b/TraktKit.xcodeproj/project.pbxproj @@ -1720,7 +1720,7 @@ ENABLE_TESTABILITY = YES; INFOPLIST_FILE = TraktKit/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_SWIFT_FLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "com.litteral.$(PRODUCT_NAME:rfc1034identifier)"; @@ -1878,7 +1878,7 @@ ENABLE_TESTABILITY = YES; INFOPLIST_FILE = TraktKit/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_SWIFT_FLAGS = "-D DEBUG"; PRODUCT_BUNDLE_IDENTIFIER = "com.litteral.$(PRODUCT_NAME:rfc1034identifier)"; @@ -1903,7 +1903,7 @@ ENABLE_TESTABILITY = YES; INFOPLIST_FILE = TraktKit/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_SWIFT_FLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "com.litteral.$(PRODUCT_NAME:rfc1034identifier)"; From df3c23e40b995f3c6485fc51c635421573edea0b Mon Sep 17 00:00:00 2001 From: Tarik Uygun Date: Sat, 9 Mar 2024 13:13:33 +0300 Subject: [PATCH 3/6] Update example project's deployment target to 13.0 --- .../TraktKitExample.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Example/TraktKitExample/TraktKitExample.xcodeproj/project.pbxproj b/Example/TraktKitExample/TraktKitExample.xcodeproj/project.pbxproj index ba183e1..961827d 100644 --- a/Example/TraktKitExample/TraktKitExample.xcodeproj/project.pbxproj +++ b/Example/TraktKitExample/TraktKitExample.xcodeproj/project.pbxproj @@ -249,7 +249,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.1; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -304,7 +304,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.1; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; @@ -320,7 +320,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = TraktKitExample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -338,7 +338,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = TraktKitExample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", From 6d1e8b6639febddc66bd86e14e0efc815198b19e Mon Sep 17 00:00:00 2001 From: Tarik Uygun Date: Sat, 9 Mar 2024 13:27:37 +0300 Subject: [PATCH 4/6] Fix version related build error --- Common/Wrapper/URLSessionProtocol.swift | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Common/Wrapper/URLSessionProtocol.swift b/Common/Wrapper/URLSessionProtocol.swift index cd181e3..e60b76b 100644 --- a/Common/Wrapper/URLSessionProtocol.swift +++ b/Common/Wrapper/URLSessionProtocol.swift @@ -23,12 +23,29 @@ public protocol URLSessionDataTaskProtocol { // MARK: Conform to protocols extension URLSession: URLSessionProtocol { + + @available(iOS, deprecated: 15.0, message: "Use the built-in API instead") + func data(from url: URLRequest) async throws -> (Data, URLResponse) { + try await withCheckedThrowingContinuation { continuation in + let task = self.dataTask(with: url) { data, response, error in + guard let data = data, let response = response else { + let error = error ?? URLError(.badServerResponse) + return continuation.resume(throwing: error) + } + + continuation.resume(returning: (data, response)) + } + + task.resume() + } + } + public func _dataTask(with request: URLRequest, completion: @escaping DataTaskResult) -> URLSessionDataTaskProtocol { dataTask(with: request, completionHandler: completion) as URLSessionDataTaskProtocol } public func data(for request: URLRequest) async throws -> (Data, URLResponse) { - try await data(for: request, delegate: nil) + try await data(from: request) } } From 92c76a53d3e175ede053ff2e15ccb49d7b3ccf5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tar=C4=B1k=20Uygun?= Date: Sat, 9 Mar 2024 13:36:57 +0300 Subject: [PATCH 5/6] Update podspec file --- TraktKit.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TraktKit.podspec b/TraktKit.podspec index 949b395..3f54105 100644 --- a/TraktKit.podspec +++ b/TraktKit.podspec @@ -6,7 +6,7 @@ Pod::Spec.new do |s| s.license = { :type => "MIT", :file => "License.md" } s.authors = "Maximilian Litteral" s.swift_version = "5.0" - s.ios.deployment_target = "12.0" + s.ios.deployment_target = "13.0" s.osx.deployment_target = "10.12" s.watchos.deployment_target = "3.0" s.tvos.deployment_target = "15.0" From bf373647faeb54e9921d09a80ada3c7ab108c1f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tar=C4=B1k=20Uygun?= Date: Sat, 9 Mar 2024 13:37:21 +0300 Subject: [PATCH 6/6] Update Package.swift file --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index bdfb1b0..936f3ad 100644 --- a/Package.swift +++ b/Package.swift @@ -7,7 +7,7 @@ let package = Package( name: "TraktKit", platforms: [ .macOS(.v12), - .iOS(.v15), + .iOS(.v13), .tvOS(.v15), .watchOS(.v8) ],