Warning
The following guide need to disable SIP to work.
Please confirm the risk of disabling the SIP by yourself.
Another solution which does not require disabling SIP is currently under investigation.
Reboot into Recovery OS + Disable SIP
import Dispatch | |
import Foundation | |
import UIKit | |
extension DispatchQueue { | |
/// Run the action immediately if it's on the main thread, otherwise dispatch it to the main thread asynchronously. | |
public static func onMainThread(_ action: @escaping () -> Void) { | |
if Thread.isMainThread { | |
action() | |
} else { |
// 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 |
#!/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"}" |
// 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) |
// | |
// UnevenRoundedRectangle.swift | |
// | |
// | |
// Created by Kyle on 2024/7/24. | |
// | |
import SwiftUI | |
@frozen |
Inspired by https://infosec.exchange/@jjtech/112612685494089718
Reboot into Recovery OS + Disable SIP
csrutil disable
// Author: SwiftUI-Lab (swiftui-lab.com) | |
// Description: Implementation of the showSizes() debugging modifier | |
// blog article: https://swiftui-lab.com/layout-protocol-part-2 | |
import SwiftUI | |
struct MeasureExample: View { | |
var body: some View { | |
VStack { |