Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Clark Clarko

  • June
  • San Francisco, CA
View GitHub Profile
@Clarko
Clarko / RemovableKeyboardShortcut.swift
Last active Mar 3, 2021
SwiftUI suppressible keyboard shortcuts
View RemovableKeyboardShortcut.swift
//
// RemovableKeyboardShortcut.swift
//
// Created by Clarko on 2/2/21.
//
// Adds an argument to dynamically remove a keyboard shortcut
//
import SwiftUI
@Clarko
Clarko / Frost.swift
Last active Aug 24, 2021
SwiftUI live-blur materials
View Frost.swift
//
// Frost.swift
//
// Created by Clarko on 7/19/20.
//
// A SwiftUI representation of UIVisualEffectView
// and UIBlurEffect, that handles mostly like a
// SwiftUI Color view. Use it as a .background()
// or on its own.
//
@Clarko
Clarko / SearchField.swift
Created Jul 18, 2020
SwiftUI search field with a keyboard focus binding
View SearchField.swift
//
// SearchField.swift
//
// Created by Clarko on 7/17/20.
//
// SwiftUI doesn't have a SearchField yet, so here's one from UIKit.
//
// The isEditing binding lets you react to keyboard focus changes,
// or control the state of keyboard focus yourself.
//
@Clarko
Clarko / ConvenientColors.swift
Last active Jul 24, 2020
SwiftUI Color Extension
View ConvenientColors.swift
//
// ConvenientColors.swift
//
// Created by Clarko on 7/15/20.
//
// Color.primary and Color.secondary are great for foreground text
// that adapts in light & dark mode, but there are a lot more
// UI Element Colors in iOS and macOS:
//
// https://developer.apple.com/documentation/uikit/uicolor/ui_element_colors