Skip to content
Merged
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
@@ -1,4 +1,4 @@
// swift-tools-version:5.3
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -7,7 +7,8 @@ let package = Package(
name: "AlertToast",
platforms: [
.iOS(.v14),
.macOS(.v11)
.macOS(.v11),
.visionOS(.v1)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
Expand Down
5 changes: 5 additions & 0 deletions Sources/AlertToast/AlertToast.swift
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ public struct AlertToastModifier: ViewModifier{
private var screen: CGRect {
#if os(iOS)
return UIScreen.main.bounds
#elseif os(visionOS)
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
return windowScene.coordinateSpace.bounds
}
return .zero
#else
return NSScreen.main?.frame ?? .zero
#endif
Expand Down