Skip to content

Commit 5824681

Browse files
authored
added visionOS support (#51)
change all #if os(iOS) to #if os(iOS) || os(visionOS) to support visionOS added visionOS as one of the supported destination
1 parent a183ee6 commit 5824681

11 files changed

+32
-24
lines changed

Drops.xcodeproj/project.pbxproj

+18-14
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,11 @@
569569
);
570570
PRODUCT_BUNDLE_IDENTIFIER = "com.omaralbeik.drops.uikit-example";
571571
PRODUCT_NAME = "$(TARGET_NAME)";
572-
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
572+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
573573
SUPPORTS_MACCATALYST = YES;
574574
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
575575
SWIFT_VERSION = 5.0;
576-
TARGETED_DEVICE_FAMILY = "1,2";
576+
TARGETED_DEVICE_FAMILY = "1,2,7";
577577
};
578578
name = Debug;
579579
};
@@ -594,11 +594,11 @@
594594
);
595595
PRODUCT_BUNDLE_IDENTIFIER = "com.omaralbeik.drops.uikit-example";
596596
PRODUCT_NAME = "$(TARGET_NAME)";
597-
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
597+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
598598
SUPPORTS_MACCATALYST = YES;
599599
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
600600
SWIFT_VERSION = 5.0;
601-
TARGETED_DEVICE_FAMILY = "1,2";
601+
TARGETED_DEVICE_FAMILY = "1,2,7";
602602
};
603603
name = Release;
604604
};
@@ -620,11 +620,12 @@
620620
);
621621
PRODUCT_BUNDLE_IDENTIFIER = "com.omaralbeik.drops.swiftui-example";
622622
PRODUCT_NAME = "$(TARGET_NAME)";
623-
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
623+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
624624
SUPPORTS_MACCATALYST = YES;
625625
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
626+
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
626627
SWIFT_VERSION = 5.0;
627-
TARGETED_DEVICE_FAMILY = "1,2";
628+
TARGETED_DEVICE_FAMILY = "1,2,7";
628629
};
629630
name = Debug;
630631
};
@@ -646,11 +647,12 @@
646647
);
647648
PRODUCT_BUNDLE_IDENTIFIER = "com.omaralbeik.drops.swiftui-example";
648649
PRODUCT_NAME = "$(TARGET_NAME)";
649-
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
650+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
650651
SUPPORTS_MACCATALYST = YES;
651652
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
653+
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
652654
SWIFT_VERSION = 5.0;
653-
TARGETED_DEVICE_FAMILY = "1,2";
655+
TARGETED_DEVICE_FAMILY = "1,2,7";
654656
};
655657
name = Release;
656658
};
@@ -782,7 +784,7 @@
782784
CLANG_ENABLE_MODULES = YES;
783785
CODE_SIGN_STYLE = Automatic;
784786
DEFINES_MODULE = YES;
785-
DEVELOPMENT_TEAM = C3VKVFB3SA;
787+
DEVELOPMENT_TEAM = 5678544286;
786788
DYLIB_COMPATIBILITY_VERSION = 1;
787789
DYLIB_CURRENT_VERSION = 1;
788790
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -798,12 +800,13 @@
798800
PRODUCT_BUNDLE_IDENTIFIER = com.omaralbeik.drops;
799801
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
800802
SKIP_INSTALL = YES;
801-
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
803+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
802804
SUPPORTS_MACCATALYST = YES;
803805
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
806+
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES;
804807
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
805808
SWIFT_VERSION = 5.0;
806-
TARGETED_DEVICE_FAMILY = "1,2";
809+
TARGETED_DEVICE_FAMILY = "1,2,7";
807810
};
808811
name = Debug;
809812
};
@@ -813,7 +816,7 @@
813816
CLANG_ENABLE_MODULES = YES;
814817
CODE_SIGN_STYLE = Automatic;
815818
DEFINES_MODULE = YES;
816-
DEVELOPMENT_TEAM = C3VKVFB3SA;
819+
DEVELOPMENT_TEAM = 5678544286;
817820
DYLIB_COMPATIBILITY_VERSION = 1;
818821
DYLIB_CURRENT_VERSION = 1;
819822
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -829,11 +832,12 @@
829832
PRODUCT_BUNDLE_IDENTIFIER = com.omaralbeik.drops;
830833
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
831834
SKIP_INSTALL = YES;
832-
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
835+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
833836
SUPPORTS_MACCATALYST = YES;
834837
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
838+
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES;
835839
SWIFT_VERSION = 5.0;
836-
TARGETED_DEVICE_FAMILY = "1,2";
840+
TARGETED_DEVICE_FAMILY = "1,2,7";
837841
};
838842
name = Release;
839843
};

Sources/AnimationContext.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(visionOS)
2525
import UIKit
2626

2727
internal struct AnimationContext {

Sources/Animator.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(visionOS)
2525
import UIKit
2626

2727
internal protocol AnimatorDelegate: AnyObject {

Sources/Drop.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(visionOS)
2525
import UIKit
2626

2727
/// An object representing a drop.

Sources/DropView.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(visionOS)
2525
import UIKit
2626

2727
internal final class DropView: UIView {
@@ -126,7 +126,9 @@ internal final class DropView: UIView {
126126
layer.shadowRadius = 25
127127
layer.shadowOpacity = 0.15
128128
layer.shouldRasterize = true
129+
#if os(iOS)
129130
layer.rasterizationScale = UIScreen.main.scale
131+
#endif
130132
layer.masksToBounds = false
131133
}
132134

Sources/Drops.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(visionOS)
2525
import UIKit
2626

2727
internal typealias AnimationCompletion = (_ completed: Bool) -> Void

Sources/PassthroughView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(visionOS)
2525
import UIKit
2626

2727
internal final class PassthroughView: UIView {

Sources/PassthroughWindow.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(visionOS)
2525
import UIKit
2626

2727
internal final class PassthroughWindow: UIWindow {

Sources/Presenter.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(visionOS)
2525
import UIKit
2626

2727
internal final class Presenter: NSObject {

Sources/Weak.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(visionOS)
2525
internal struct Weak<T: AnyObject> {
2626
init(value: T?) {
2727
self.value = value

Sources/WindowViewController.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
#if os(iOS)
24+
#if os(iOS) || os(visionOS)
2525
import UIKit
2626

2727
internal final class WindowViewController: UIViewController {
@@ -52,7 +52,9 @@ internal final class WindowViewController: UIViewController {
5252
}
5353

5454
func install() {
55+
#if os(iOS)
5556
window?.frame = UIScreen.main.bounds
57+
#endif
5658
window?.isHidden = false
5759
if let window = window, let activeScene = UIApplication.shared.activeWindowScene {
5860
window.windowScene = activeScene

0 commit comments

Comments
 (0)