Skip to content

Instantly share code, notes, and snippets.

View Kyle-Ye's full-sized avatar
💭

Kyle Kyle-Ye

💭
View GitHub Profile
@unixzii
unixzii / ContentView.swift
Last active March 30, 2024 08:36
GPU particle system using Metal.
import SwiftUI
struct SmashableView: NSViewRepresentable {
typealias NSViewType = _SmashableNSView
let text: String
class _SmashableNSView: NSView {
@swiftui-lab
swiftui-lab / showSizes.swift
Last active May 11, 2024 03:54
A debugging modifier for SwiftUI views (showSizes)
// 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 {
@edudnyk
edudnyk / TestsApp.swift
Last active January 9, 2024 09:48
SwiftUI Easter Eggs: Performance Benchmarking with _ViewTest and more
import SwiftUI
@main
struct App {
static func main() {
_TestApp().runBenchmarks([Benchmark()])
}
}
extension UIHostingController: _Test where Content == AnyView {}
@ole
ole / !swiftui-reflection-dump.md
Last active June 24, 2024 18:00
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.