Skip to content

Instantly share code, notes, and snippets.

View nonisolated's full-sized avatar

Dmitry Baginsky nonisolated

View GitHub Profile
import notify
import Combine
enum Notify {}
extension Notify {
struct Status: Error {
let rawValue: UInt32
init(_ rawValue: UInt32) {
self.rawValue = rawValue
@gdavis
gdavis / ThreadSafe.swift
Last active June 28, 2025 08:58
ThreadSafe is a property wrapper that can be used to control atomic access to the underlying property while allowing concurrent access to reading the value.
//
// ThreadSafe.swift
// GDICore
//
// Created by Grant Davis on 1/2/21.
// Updated to support `_modify` accessor on 12/5/21.
//
// Copyright © 2021 Grant Davis Interactive, LLC. All rights reserved.
//
import Foundation
import Foundation
import SwiftUI
// Implemented based on this article:
// https://noahgilmore.com/blog/swiftui-self-sizing-cells
// MARK: - HostingTableViewCell
public final class HostingTableViewCell<Content: View>: UITableViewCell {
private var hostingController = UIHostingController<Content?>(rootView: nil)
@SaganRitual
SaganRitual / Box.swift
Created February 4, 2019 14:37
SpriteKit starter, draw grid, detect touches on sprites, cause neighboring sprites to react
import Foundation
import SpriteKit
class Box {
let sprite: SKShapeNode
let cellAddress: XYPair
var position: CGPoint {
get { return sprite.position }
set { sprite.position = newValue }