This file contains hidden or 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
import Testing | |
import SwiftUI | |
@testable import Demo | |
typealias PlatformViewController = UIViewController | |
typealias PlatformWindow = UIWindow | |
typealias PlatformHostingController = UIHostingController | |
extension PlatformViewController { | |
// NOTE: Remember to withExtendedLifetime for window to ensure it is not deallocated duration animation or update. |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.github.actions-runner</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/bin/bash</string> |
This file contains hidden or 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
#!/bin/bash | |
# A temporay workaround for https://github.com/swiftlang/swift-corelibs-foundation/issues/5211 | |
set -e | |
# Find the path to swift binary | |
SWIFT_PATH=$(which swift) | |
echo "Swift binary found at: $SWIFT_PATH" | |
# Extract the toolchain path from swift binary path | |
# Remove /usr/bin/swift from the path to get the toolchain root |
This file contains hidden or 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
// Ref: https://x.com/KyleSwifter/status/1899663558914572653 | |
// The iOS 18 SwiftUI SDK has an API to change the semantic - _TestApp().setSemantics(xx). | |
// Remember to make it public in your SDK. | |
// For lower OS version, the API does not exist. | |
// But `_TestApp.run()` will read and set it from the `CommandLine.arguments` after `--semantics`. | |
@main | |
struct SemanticsTestsApp: App { | |
init() { | |
let app = _TestApp() |
This file contains hidden or 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
// Set up swift repo | |
mkdir -p ~/tmp/build/swift-project | |
cd ~/tmp/build/swift-project | |
git clone [email protected]:swiftlang/swift.git | |
// Update the swift-project | |
cd swift | |
utils/update-checkout --clone-with-ssh | |
// Check out to the 5.10 release |
This file contains hidden or 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
#!/bin/bash | |
# Script modified from https://docs.emergetools.com/docs/analyzing-a-spm-framework-ios | |
set -e | |
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd -P)" | |
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" | |
PROJECT_BUILD_DIR="${PROJECT_BUILD_DIR:-"${PROJECT_ROOT}/build"}" |
This file contains hidden or 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
// Based on https://gist.github.com/liamnichols/a2e656ae93a597952b4427bcfa371185 | |
// Add allowsSelfSizing support to support inputViewController custom height | |
// If you need fully dynamic height, please try https://gist.github.com/hannesoid/74ec9022021835598acf17564ce76a5a | |
/// `UIInputViewController` subclass that wraps a `UIHostingController` allowing you to embed SwiftUI inside `inputAccessoryViewController` and friends. | |
fileprivate class InputHostingViewController<Content: View>: UIInputViewController { | |
let hostingViewController: UIHostingController<Content> | |
init(rootView: Content) { | |
self.hostingViewController = UIHostingController(rootView: rootView) | |
super.init(nibName: nil, bundle: nil) |
This file contains hidden or 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
// | |
// UnevenRoundedRectangle.swift | |
// | |
// | |
// Created by Kyle on 2024/7/24. | |
// | |
import SwiftUI | |
@frozen |
NewerOlder