Skip to content

Instantly share code, notes, and snippets.

View Chronos2500's full-sized avatar

ビスター Chronos2500

View GitHub Profile
@Chronos2500
Chronos2500 / !swiftui-reflection-dump.md
Created November 24, 2025 16:17 — forked from ole/!swiftui-reflection-dump.md
A dump of the SwiftUI.framework binary for the iOS simulator (as of Xcode 12.0 beta 2) using the swift-reflection-dump tool.

A dump of the SwiftUI.framework binary for the iOS simulator (as of Xcode 12.0 beta 2) using the swift-reflection-dump tool.

Note: I used a Swift 5.3 compiler build from a few weeks ago that I had laying around. Because of ABI stability, I don't think the swift-reflection-dump version has to match the compiler version that was used to build the binary, but I'm not 100% sure.

@Chronos2500
Chronos2500 / FullSheet.Swift
Created August 14, 2025 13:13
FullDetentSheet
import SwiftUI
struct FullSheet: View {
@State private var isPresented: Bool = false
@Namespace private var namespace
var body: some View {
TabView {
Tab("Home", systemImage: "house") {
NavigationStack {
list
@Chronos2500
Chronos2500 / BackdropBlurView.swift
Last active July 22, 2025 20:07 — forked from Rukh/BackdropBlurView.swift
UIVisualEffectView with any blur radius in SwiftUI
//
// BackdropBlurView.swift
//
// Created by Dmitry Gulyagin on 20.09.2022.
//
import SwiftUI
/// A View which content reflects all behind it
struct BackdropView: UIViewRepresentable {
@Chronos2500
Chronos2500 / AllowsSwipeBack.Swift
Created May 16, 2025 17:59
This should be declared only once in the root view of the NavigationStack.
import SwiftUI
extension View {
/// Allows swipe back when navigation bar is hidden.
/// This modifier should be applied to a view that resides within a NavigationStack.
/// - Returns: A view that allows swipe back when navigation bar is hidden.
public func allowsSwipeBackWhenNavBarHidden() -> some View {
modifier( AllowsSwipeBackWhenNavBarHiddenModifier() )
}
}
@Chronos2500
Chronos2500 / MarqueeLabel-Minimal.swift
Created May 13, 2025 15:19
MarqueeLabel Please be fully aware that these use Private APIs.
let label = UILabel()
label.text = "Swift is a modern, intuitive programming language crafted for all Apple platforms."
label.setValue(true, forKey: "marqueeEnabled")
label.setValue(true, forKey: "marqueeRunning")
label.setValue(0, forKey: "marqueeRepeatCount")
@Chronos2500
Chronos2500 / Example.Swift
Last active June 22, 2025 18:54
UIBlurEffectStyle一覧
// Example
// Custom extension to add a blur effect style with raw value 1100
extension UIBlurEffect.Style {
static var systemChromeBackground: UIBlurEffect.Style {
return UIBlurEffect.Style(rawValue: 1100) ?? .dark
}
}
import SwiftUI
struct ContentView: View {
@State var maxNumber: Int = 50
var body: some View {
Text(verbatim: "Bounce-BasedOnSize")
Slider(value: Binding(
get: { Double(maxNumber) },
set: { maxNumber = Int($0) }
), in: 1...50, step: 1)
import SwiftUI
//自作パッケージの切り出しなので変数名がめちゃくちゃです
//詳しくはこれの実装を見てください https://github.com/Chronos2500/CustomNavigationTitle
struct ContentView: View {
var body: some View {
NavigationStack{
ScrollView {
Color.blue.frame(height: 200)
@Chronos2500
Chronos2500 / ContentView.swift
Created March 6, 2025 12:05
ignoreSafeAreaの動的変更のデモ
import SwiftUI
struct ContentView: View {
@State private var ignoreSafeArea = false
var body: some View {
ZStack {
Color.blue
.ignoresSafeArea(edges: ignoreSafeArea ? .all : [])