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
// 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 { |
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
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 |
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
// | |
// APIKeyManager.swift | |
// Demo | |
// | |
// Created by Kyle on 2023/11/25. | |
// | |
import Foundation | |
import Security |
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
// 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 |
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
// 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( |
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
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,') |
NewerOlder