Skip to content

Instantly share code, notes, and snippets.

@acosmicflamingo
acosmicflamingo / KeychainStrategyKey.swift
Created March 4, 2026 17:33
Power Keychain Persistence Strategy via Point-Free's Sharing library
import Dependencies
import Foundation
import Security
import Sharing
// MARK: - DependencyValues
extension DependencyValues {
public var keychainClient: KeychainClient {
get { self[KeychainClient.self] }
@acosmicflamingo
acosmicflamingo / UIColor+HighContrast
Created June 15, 2023 14:31
UIColor Convenience Initializer for Supporting High-Contrast
import UIKit
extension UIColor {
/// Instantiate UIColor with support for high contrast mode
/// - Parameters:
/// - light: color to use when userInterfaceStyle is light and normal contrast
/// - dark: color to use when userInterfaceStyle is dark and normal contrast
/// - lightHC: color to use when userInterfaceStyle is light and high contrast
/// - darkHC: color to use when userInterfaceStyle is dark and high contrast
public convenience init(