Skip to content

Instantly share code, notes, and snippets.

View frankschlegel's full-sized avatar

Frank Rupprecht frankschlegel

View GitHub Profile
@frankschlegel
frankschlegel / TipShim.swift
Last active September 4, 2023 07:51
Working with TipKit when still supporting iOS 16 and below
import TipKit
/// Small helper protocol for a tip that is available below iOS 17
/// so that we can pass tips around and have members storing tips
/// (as stored properties can't be marked with `@available`).
@available(iOS, obsoleted: 17, message: "Can be removed once we only support iOS 17+")
public protocol TipShim {
@available(iOS 17, *)
@frankschlegel
frankschlegel / Combine+SelfBindings.swift
Last active February 17, 2024 02:14
Convenience extensions for Combine adding memory-save bindings and Cancellable management
import Combine
/// Classes implementing this protocol can be target of convenience Publisher
/// bindings and assignments without causing accidental retain cycles.
/// Those bindings and assignments are also released together with the target.
///
/// For example:
///
/// aPublisher.bind(to: self) { me, object in
@frankschlegel
frankschlegel / gist:10552674
Created April 12, 2014 19:34
Keybase proof
### Keybase proof
I hereby claim:
* I am frankschlegel on github.
* I am frankschlegel (https://keybase.io/frankschlegel) on keybase.
* I have a public key whose fingerprint is BBA5 D882 BABA F1F1 5B12 3D48 4B1C 9B9A 2755 EF07
To claim this, I am signing this object: