Skip to content

Commit

Permalink
fix for compilation in Swift 5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeichhorn committed Oct 21, 2024
1 parent 99972f3 commit f1759f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/YouTubeKit/Extensions/URLSessionDelegates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ final class ConfigurableURLSessionDelegate: NSObject, URLSessionTaskDelegate {
let applyCookiesOnRedirect: Bool
let saveIntermediateResponses: Bool

#if swift(>=5.10)
nonisolated(unsafe) var intermediateResponses = [HTTPURLResponse]()
#else
var intermediateResponses = [HTTPURLResponse]()
#endif

init(allowsRedirect: Bool, applyCookiesOnRedirect: Bool, saveIntermediateResponses: Bool) {
self.allowsRedirects = allowsRedirect
Expand Down
5 changes: 5 additions & 0 deletions Sources/YouTubeKit/YouTube.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ public class YouTube {
private var _js: String?
private var _jsURL: URL?

#if swift(>=5.10)
nonisolated(unsafe) private static var __js: String? // caches js between calls
nonisolated(unsafe) private static var __jsURL: URL?
#else
private static var __js: String? // caches js between calls
private static var __jsURL: URL?
#endif

private var _videoInfos: [InnerTube.VideoInfo]?

Expand Down

0 comments on commit f1759f4

Please sign in to comment.