Skip to content

Instantly share code, notes, and snippets.

View JimRoepcke's full-sized avatar

Jim Roepcke JimRoepcke

View GitHub Profile
@danielctull
danielctull / UnwrapView.swift
Last active November 5, 2019 00:43
A view which takes a value and shows one view or another depending on whether the value is nil or not.
import SwiftUI
public struct UnwrapView<Some: View, None: View>: View {
private let some: () -> Some?
private let none: () -> None?
public init<Value>(value: Value?,
some: @escaping (Value) -> Some,
@ChrisPenner
ChrisPenner / Optics Cheatsheet.md
Last active August 12, 2025 12:57
Optics Cheatsheet
@marcpalmer
marcpalmer / ExtendedScrollView.swift
Created March 5, 2020 21:20
Work in progress UIScrollView-alike in SwiftUI
//
// ContentView.swift
// ExtendedScrolView
//
// Created by Marc Palmer on 05/03/2020.
// Copyright © 2020 Montana Floss Co. Ltd. All rights reserved.
//
import SwiftUI
import SwiftUI
import UIKit
enum ScalableFont {
case system(size: CGFloat, weight: Font.Weight = .regular, design: Font.Design = .default)
case custom(_ name: String, size: CGFloat)
var size: CGFloat {