Skip to content

Instantly share code, notes, and snippets.

View xenodium's full-sized avatar
😸
[in Emacs]

xenodium

😸
[in Emacs]
View GitHub Profile
@xenodium
xenodium / boilerplate.swift
Last active May 20, 2023 06:02 — forked from chriseidhof/boilerplate.swift
QuickMacApp
// Run any SwiftUI view as a Mac app.
// Based on https://gist.github.com/chriseidhof/26768f0b63fa3cdf8b46821e099df5ff
import Cocoa
import SwiftUI
NSApplication.shared.run {
VStack(spacing: 0) {
Rectangle().fill(Color.green)
Rectangle().fill(Color.yellow)
@xenodium
xenodium / LinkedText.swift
Created October 31, 2021 14:38 — forked from mjm/LinkedText.swift
Tappable links in SwiftUI Text view
import SwiftUI
private let linkDetector = try! NSDataDetector(types: NSTextCheckingResult.CheckingType.link.rawValue)
struct LinkColoredText: View {
enum Component {
case text(String)
case link(String, URL)
}