macos reachability

This commit is contained in:
Mike Renoir 2023-12-05 15:30:41 +04:00
parent 492a91377a
commit 6a41527153
5 changed files with 64 additions and 6 deletions

View File

@ -0,0 +1,27 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "MetalEngine",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "MetalEngine",
targets: ["MetalEngine"]),
],
dependencies: [
.package(name: "ShelfPack", path: "../Utils/ShelfPack"),
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "MetalEngine",
dependencies: [.product(name: "ShelfPack", package: "ShelfPack", condition: nil)],
path: "Sources/MetalEngine"),
]
)

View File

@ -1,8 +1,12 @@
import Foundation
import Metal
import UIKit
import IOSurface
#if os(iOS)
import Display
import UIKit
#endif
import IOSurface
import ShelfPack
public final class Placeholder<Resolved> {

View File

@ -84,7 +84,7 @@ private final class WrappedLegacyReachability: NSObject {
}
}
@available(iOSApplicationExtension 12.0, iOS 12.0, OSX 10.14, *)
@available(iOSApplicationExtension 12.0, iOS 12.0, OSX 13.0, *)
private final class PathMonitor {
private let queue: Queue
private let monitor: NWPathMonitor
@ -133,7 +133,7 @@ private final class PathMonitor {
}
}
@available(iOSApplicationExtension 12.0, iOS 12.0, OSX 10.14, *)
@available(iOSApplicationExtension 12.0, iOS 12.0, OSX 13.0, *)
private final class SharedPathMonitor {
static let queue = Queue()
static let impl = QueueLocalObject<PathMonitor>(queue: queue, generate: {
@ -149,7 +149,7 @@ public enum Reachability {
}
public static var networkType: Signal<NetworkType, NoError> {
if #available(iOSApplicationExtension 12.0, iOS 12.0, OSX 10.14, *) {
if #available(iOSApplicationExtension 12.0, iOS 12.0, OSX 13.0, *) {
return Signal { subscriber in
let disposable = MetaDisposable()

@ -1 +1 @@
Subproject commit fa2e53f5da9b9653ab47169a922fb6c82847134a
Subproject commit 8f41ea265404dea86f2444a47343993ccdc3a64e

View File

@ -0,0 +1,27 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "ShelfPack",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "ShelfPack",
targets: ["ShelfPack"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "ShelfPack",
dependencies: [],
path: ".",
publicHeadersPath: "PublicHeaders"),
]
)