Skip to content

Instantly share code, notes, and snippets.

View technocidal's full-sized avatar
🌍
Working remote

Johannes Ebeling technocidal

🌍
Working remote
View GitHub Profile
//
// OCXML.swift
// Created by Marco Arment on 9/23/24.
//
// Released into the public domain. Do whatever you'd like with this.
// No guarantees that it'll do anything, or do it correctly. Good luck!
//
import Foundation
@christianselig
christianselig / LongPressButton.swift
Last active November 4, 2024 06:52
How to accomplish a long-pressable button in SwiftUI with two different techniques. The first just uses SwiftUI but due to the simultaneous gesture requirement you also have to ensure both don't fire concurrently. The second uses UIKit and wraps UIButton and UILongPressGestureRecognizer which natively handles this behavior.
import SwiftUI
// PURE SwiftUI way with State tracking to prevent double events
struct ContentView: View {
@State private var ignoreTapEvent = false
var body: some View {
Button {
guard !ignoreTapEvent else {

Merlin's First Fruity Pleaser

Ingredients

  • Peychaud's Bitters | 3-5 squirts
  • Angostura Bitters | 2-5 squirts
  • Regular Crappy Bottled ReaLime® | 1+ capful
  • Seltzer Water | 12 oz | Chilled

Steps