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
// 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 { |
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 |