Skip to content
Closed
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
5 changes: 3 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let package = Package(
.iOS(.v15),
.macCatalyst(.v15),
.macOS(.v10_15),
.visionOS(.v1)
],
products: [
.library(
Expand All @@ -35,7 +36,7 @@ let package = Package(
name: "QuickLayout",
dependencies: [
"QuickLayoutMacro",
.target(name: "QuickLayoutBridge", condition: .when(platforms: [.iOS, .macCatalyst])),
.target(name: "QuickLayoutBridge", condition: .when(platforms: [.iOS, .macCatalyst, .visionOS])),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't .macOS be added here as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think so. QuickLayoutBridge uses UIKit, so it won't compile on macOS.

],
path: "Sources/QuickLayout/QuickLayout",
exclude: [
Expand Down Expand Up @@ -65,7 +66,7 @@ let package = Package(
name: "QuickLayoutBridge",
dependencies: [
"FastResultBuilder",
.target(name: "QuickLayoutCore", condition: .when(platforms: [.iOS, .macCatalyst])),
.target(name: "QuickLayoutCore", condition: .when(platforms: [.iOS, .macCatalyst, .visionOS])),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be done with a refactoring but QuickLayoutCore has few dependencies to UIKit.

],
path: "Sources/QuickLayout/QuickLayoutBridge",
exclude: [
Expand Down
2 changes: 2 additions & 0 deletions Sources/QuickLayout/QuickLayoutCore/PixelGridRounding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import UIKit
private struct ScreenScale {
static let value: CGFloat = {
var scale: CGFloat = 1.0
#if !os(visionOS)
if Thread.isMainThread {
MainActor.assumeIsolated { // patternlint-disable-line swift-mainactor-assumeisolated
scale = UIScreen.main.scale
Expand All @@ -20,6 +21,7 @@ private struct ScreenScale {
scale = UIScreen.main.scale
}
}
#endif
return scale
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there no equivalent to UIScreen.scale on visionOS, it's reasonable to return 1.0.

}()
}
Expand Down
Loading