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
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 { |
struct TappablePadding: ViewModifier { | |
let edges: Edge.Set | |
let insets: EdgeInsets? | |
let perform: () -> Void | |
init(edges: Edge.Set = .all, insets: EdgeInsets?, perform: @escaping () -> Void) { | |
self.edges = edges | |
self.insets = insets | |
self.perform = perform |
// | |
// APIKeyManager.swift | |
// Demo | |
// | |
// Created by Kyle on 2023/11/25. | |
// | |
import Foundation | |
import Security |
// The behavior before iOS 17/Xcode 15: | |
// Dynamic Island Device: Alert if app is in background | |
// non-Dynamic Island Device: Alert if app is in background | |
// | |
// The behavior after iOS 17/Xcode 15: | |
// Dynamic Island Device: Alert if or after app is in background | |
// non-Dynamic Island Device: Alert immediately | |
// | |
// "Alert" means a pop-up live activity card with white backgroun | |
// To workaround the buggy UI behavior for non-Dynamic Island Device on iOS 17 |
// swift-tools-version: 5.8 | |
// The swift-tools-version declares the minimum version of Swift required to build this package. | |
import Foundation | |
import PackageDescription | |
let isXcodeEnv = ProcessInfo.processInfo.environment["__CFBundleIdentifier"] == "com.apple.dt.Xcode" | |
// Xcode use clang as linker which supports "-iframework" while SwiftPM use swiftc as linker which supports "-Fsystem" | |
let systemFrameworkSearchFlag = isXcodeEnv ? "-iframework" : "-Fsystem" | |
let package = Package( |
download() { | |
gh repo clone apple-oss-distributions/distribution-macOS | |
cd distribution-macOS | |
# checkout to macos-123 since Xcode 13.4 is bundled with macOS 12.3 SDK | |
git checkout tags/macos-123 | |
export TOOLCHAIN_PATH=$(cd `xcrun -sdk macosx -show-sdk-platform-path`/../../Toolchains/XcodeDefault.xctoolchain && pwd) | |
export SDKPATH=$(xcrun -sdk macosx -show-sdk-path) | |
export XCODEPATH=$(xcrun -sdk macosx -show-sdk-path | sed 's,\(.*/Xcode[^/]*\.app\)/.*,\1,') |