Skip to content

Instantly share code, notes, and snippets.

View neknalb's full-sized avatar

neknalb

  • Halocline GmbH & Co. KG
  • Germany, Osnabrück
View GitHub Profile
@neknalb
neknalb / Using Combine with debounce.swift
Created July 29, 2022 17:33
Using Combine with debounce to update document model when editing NSAttributedString in view
// MARK: - Model
struct DocumentData: Codable {
var title: String
var blocks: Array<Block>
...
}
// MARK: - View
@neknalb
neknalb / TextViewWithIntrinsicContentSize.swift
Last active March 3, 2022 09:45
A SwiftUI text view resizing horizontally according to its superview and vertically to fit its current text content – using NSTextView and intrinsicContentSize.
//
// TextViewWithIntrinsicContentSize.swift
//
// Created by Malte Blanken on 03.03.22.
//
// https://github.com/neknalb
//
// MIT license
//