Skip to content

Fix build error #62

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
19 changes: 18 additions & 1 deletion Common/Wrapper/URLSessionProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let package = Package(
name: "TraktKit",
platforms: [
.macOS(.v12),
.iOS(.v15),
.iOS(.v13),
.tvOS(.v15),
.watchOS(.v8)
],
Expand Down
2 changes: 1 addition & 1 deletion TraktKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 11 additions & 3 deletions TraktKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -302,6 +304,8 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
269486FF2B9C6B6D00455FAA /* UserResource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserResource.swift; sourceTree = "<group>"; };
269487012B9C6BAC00455FAA /* SearchResource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchResource.swift; sourceTree = "<group>"; };
70005645206BBD30005319DD /* test_get_users_watching_now.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = test_get_users_watching_now.json; sourceTree = "<group>"; };
70005647206BBF47005319DD /* TraktEpisodeTranslation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TraktEpisodeTranslation.swift; sourceTree = "<group>"; };
7000564B206BC209005319DD /* test_get_all_episode_translations.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = test_get_all_episode_translations.json; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1108,13 +1112,15 @@
74A88269267772220075491B /* Resources */ = {
isa = PBXGroup;
children = (
269487012B9C6BAC00455FAA /* SearchResource.swift */,
74A8827E267772B10075491B /* TraktManager+AsyncAwait.swift */,
74A8827A267772A30075491B /* TraktManager+Resources.swift */,
74A8826A267772360075491B /* ShowResource.swift */,
74A8826E267772410075491B /* SeasonResource.swift */,
74A88272267772490075491B /* EpisodeResource.swift */,
74A882762677724E0075491B /* MovieResource.swift */,
74A8828226777C770075491B /* ExploreResource.swift */,
269486FF2B9C6B6D00455FAA /* UserResource.swift */,
);
path = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -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 */,
Expand All @@ -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 */,
Expand Down Expand Up @@ -1712,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)";
Expand Down Expand Up @@ -1870,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)";
Expand All @@ -1895,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)";
Expand Down