Skip to content

Instantly share code, notes, and snippets.

View llsc12's full-sized avatar
💭
doing swift stuff?

Lakhan Lothiyi llsc12

💭
doing swift stuff?
View GitHub Profile
@stephancasas
stephancasas / IntelligenceUIPlatterView.swift
Created February 14, 2025 23:49
A SwiftUI expression of Apple Intelligence' NSIntelligenceUIPlatterView — used to accent intelligence-enabled UI components.
//
// IntelligenceUIPlatterView.swift
//
// Created by Stephan Casas on 2/13/25.
//
import SwiftUI
import AppKit
import Combine
@IanKeen
IanKeen / EnvironmentValues.swift
Last active June 20, 2025 23:44
SwiftUI: Peek at/extract hidden environment values
import Foundation
import SwiftUI
extension EnvironmentValues {
public func value<T>(_: T.Type = T.self, forKey key: String) -> T? {
guard let value = first(where: { name($0, equals: key) }) else {
print("No EnvironmentValue with key '\(key)' found.")
return nil
}
@michaelevensen
michaelevensen / View+Geometry.swift
Last active November 13, 2023 12:20
A really handy extension to `View` which enables dynamic binding of `GeometryReader` properties like `Size`, `Frame` and `SafeAreaInsets` for a `View`. This is particularly handy when you want to share `GeometryReader` output between other `View`'s. All credit goes to @danielsaidi.
//
// View+Geometry.swift
// SwiftUIKit
//
// Created by Daniel Saidi on 2020-03-26.
// Copyright © 2020 Daniel Saidi. All rights reserved.
//
import SwiftUI