Skip to content

Commit

Permalink
removed special changes for MacCatalyst again
Browse files Browse the repository at this point in the history
* with coming out xCode 12.3 we also have support for configurable network cache in mac catalyst
  • Loading branch information
Philipp Homann authored and Philipp Homann committed Apr 16, 2021
1 parent 20f0472 commit 1c9e074
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ extension NetworkLayer {
self.initialize()
}

// not for Mac Catalyst
// "The new required URLCache initializer init(memoryCapacity:diskCapacity:diskPath:) is currently unimplemented. (50739637)" from Known Issues in https://developer.apple.com/documentation/macos_release_notes/macos_10_15_beta_release_notes
#if !targetEnvironment(macCatalyst)
/**
Initialize cache with the specified capacity preferences and path.
- parameter memoryCapacity: The RAM demand. Set `0` if you don't want to use temporary memory
Expand All @@ -49,7 +46,6 @@ extension NetworkLayer {
super.init(memoryCapacity: memoryCapacity, diskCapacity: diskCapacity, diskPath: path)
self.initialize()
}
#endif

/// Registers `NotificationCenter` for necessary messages.
private func initialize() {
Expand Down
6 changes: 0 additions & 6 deletions Sources/UsefulNetworkLayer/NetworkLayer/NetworkLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,9 @@ public class NetworkLayer: NSObject, URLSessionDataDelegate {
/// Holds cache of the `NetworkLayer`.
public var _cache: Cache? {
get {
// not for Mac Catalyst
// "The new required URLCache initializer init(memoryCapacity:diskCapacity:diskPath:) is currently unimplemented. (50739637)" from Known Issues in https://developer.apple.com/documentation/macos_release_notes/macos_10_15_beta_release_notes
#if !targetEnvironment(macCatalyst)
return NetworkLayer.Cache(memoryCapacity: 0,
diskCapacity: 150 * 1024 * 1024,
diskPath: nil)
#else
return NetworkLayer.Cache()
#endif
}
}

Expand Down

0 comments on commit 1c9e074

Please sign in to comment.