Skip to content

Commit

Permalink
added visionOS support (#51)
Browse files Browse the repository at this point in the history
change all #if os(iOS) to #if os(iOS) || os(visionOS) to support visionOS
added visionOS as one of the supported destination
  • Loading branch information
Ju-Long authored Oct 11, 2024
1 parent a183ee6 commit 5824681
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 24 deletions.
32 changes: 18 additions & 14 deletions Drops.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +569,11 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.omaralbeik.drops.uikit-example";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,7";
};
name = Debug;
};
Expand All @@ -594,11 +594,11 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.omaralbeik.drops.uikit-example";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,7";
};
name = Release;
};
Expand All @@ -620,11 +620,12 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.omaralbeik.drops.swiftui-example";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,7";
};
name = Debug;
};
Expand All @@ -646,11 +647,12 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.omaralbeik.drops.swiftui-example";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,7";
};
name = Release;
};
Expand Down Expand Up @@ -782,7 +784,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = C3VKVFB3SA;
DEVELOPMENT_TEAM = 5678544286;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -798,12 +800,13 @@
PRODUCT_BUNDLE_IDENTIFIER = com.omaralbeik.drops;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,7";
};
name = Debug;
};
Expand All @@ -813,7 +816,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = C3VKVFB3SA;
DEVELOPMENT_TEAM = 5678544286;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -829,11 +832,12 @@
PRODUCT_BUNDLE_IDENTIFIER = com.omaralbeik.drops;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,7";
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Sources/AnimationContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#if os(iOS)
#if os(iOS) || os(visionOS)
import UIKit

internal struct AnimationContext {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Animator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#if os(iOS)
#if os(iOS) || os(visionOS)
import UIKit

internal protocol AnimatorDelegate: AnyObject {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Drop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#if os(iOS)
#if os(iOS) || os(visionOS)
import UIKit

/// An object representing a drop.
Expand Down
4 changes: 3 additions & 1 deletion Sources/DropView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#if os(iOS)
#if os(iOS) || os(visionOS)
import UIKit

internal final class DropView: UIView {
Expand Down Expand Up @@ -126,7 +126,9 @@ internal final class DropView: UIView {
layer.shadowRadius = 25
layer.shadowOpacity = 0.15
layer.shouldRasterize = true
#if os(iOS)
layer.rasterizationScale = UIScreen.main.scale
#endif
layer.masksToBounds = false
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Drops.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#if os(iOS)
#if os(iOS) || os(visionOS)
import UIKit

internal typealias AnimationCompletion = (_ completed: Bool) -> Void
Expand Down
2 changes: 1 addition & 1 deletion Sources/PassthroughView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#if os(iOS)
#if os(iOS) || os(visionOS)
import UIKit

internal final class PassthroughView: UIView {
Expand Down
2 changes: 1 addition & 1 deletion Sources/PassthroughWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#if os(iOS)
#if os(iOS) || os(visionOS)
import UIKit

internal final class PassthroughWindow: UIWindow {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Presenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#if os(iOS)
#if os(iOS) || os(visionOS)
import UIKit

internal final class Presenter: NSObject {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Weak.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#if os(iOS)
#if os(iOS) || os(visionOS)
internal struct Weak<T: AnyObject> {
init(value: T?) {
self.value = value
Expand Down
4 changes: 3 additions & 1 deletion Sources/WindowViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#if os(iOS)
#if os(iOS) || os(visionOS)
import UIKit

internal final class WindowViewController: UIViewController {
Expand Down Expand Up @@ -52,7 +52,9 @@ internal final class WindowViewController: UIViewController {
}

func install() {
#if os(iOS)
window?.frame = UIScreen.main.bounds
#endif
window?.isHidden = false
if let window = window, let activeScene = UIApplication.shared.activeWindowScene {
window.windowScene = activeScene
Expand Down

0 comments on commit 5824681

Please sign in to comment.