generated from StanfordBDHG/SwiftPackageTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for visionOS and macOS (#20)
# Optimize text input on visionOS ## ♻️ Current situation & Problem The current approach for textfield selection does not work on visionOS. This PR addresses the issue by replacing the current solution via a simple "tap" on visionOS. Our automatic text input correction should catch the case where the tap will set the cursor in the middle of the text. This resolves #19. Further, keyboards and alerts are in separate processes in visionOS. This PR accounts for that and updates the respective implementations. ## ⚙️ Release Notes * Fix smaller issues with visionOS. ## 📚 Documentation Minor adjustments. ## ✅ Testing * Added a new test case that explicitly checks the use case of entering text in a text field, prefilled with long text. * Added CI support for visionOS. ### Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).
- Loading branch information
Showing
15 changed files
with
358 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// | ||
// This source file is part of the Stanford Spezi open-source project | ||
// | ||
// SPDX-FileCopyrightText: 2024 Stanford University and the project authors (see CONTRIBUTORS.md) | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
|
||
import XCTest | ||
|
||
// Use `xcrun simctl spawn booted launchctl list` to check for all bundle identifiers running on visionOS simulator. | ||
// If you are in search for an application bundle identifier you have a good chance of finding it there. | ||
|
||
|
||
extension XCUIApplication { | ||
/// Get access to the visionOS keyboard application. | ||
@available(macOS, unavailable) | ||
@available(iOS, unavailable) | ||
@available(tvOS, unavailable) | ||
@available(watchOS, unavailable) | ||
@available(visionOS 1, *) | ||
public static var visionOSKeyboard: XCUIApplication { | ||
XCUIApplication(bundleIdentifier: "com.apple.RealityKeyboard") | ||
} | ||
|
||
/// Get access to the visionOS keyboard application. | ||
@available(macOS, unavailable) | ||
@available(iOS, unavailable) | ||
@available(tvOS, unavailable) | ||
@available(watchOS, unavailable) | ||
@available(visionOS 1, *) | ||
public var visionOSKeyboard: XCUIApplication { | ||
Self.visionOSKeyboard | ||
} | ||
} | ||
|
||
|
||
extension XCUIApplication { | ||
/// Get access to the visionOS notifications application. | ||
/// | ||
/// This is the applications that is responsible for drawing all | ||
@available(macOS, unavailable) | ||
@available(iOS, unavailable) | ||
@available(tvOS, unavailable) | ||
@available(watchOS, unavailable) | ||
@available(visionOS 1, *) | ||
public static var visionOSNotifications: XCUIApplication { | ||
XCUIApplication(bundleIdentifier: "com.apple.RealityNotifications") | ||
} | ||
|
||
/// Get access to the visionOS notifications application. | ||
/// | ||
/// This is the applications that is responsible for drawing all | ||
@available(macOS, unavailable) | ||
@available(iOS, unavailable) | ||
@available(tvOS, unavailable) | ||
@available(watchOS, unavailable) | ||
@available(visionOS 1, *) | ||
public var visionOSNotifications: XCUIApplication { | ||
Self.visionOSNotifications | ||
} | ||
} |
Oops, something went wrong.