Skip to content

Instantly share code, notes, and snippets.

I'm probably napping

Matt Moriarity mjm

I'm probably napping
View GitHub Profile
mjm / main.go
Created Mar 21, 2019
Instant clone a vSphere VM
View main.go
package main
import (
mjm / ManagedObjectChangesPublisher.swift
Created Nov 3, 2019
Observe changes to a Core Data fetch request with Combine
View ManagedObjectChangesPublisher.swift
import Combine
import CoreData
extension NSManagedObjectContext {
func changesPublisher<Object: NSManagedObject>(for fetchRequest: NSFetchRequest<Object>)
-> ManagedObjectChangesPublisher<Object>
ManagedObjectChangesPublisher(fetchRequest: fetchRequest, context: self)
mjm / LinkedText.swift
Created May 21, 2020
Tappable links in SwiftUI Text view
View LinkedText.swift
import SwiftUI
private let linkDetector = try! NSDataDetector(types:
struct LinkColoredText: View {
enum Component {
case text(String)
case link(String, URL)
mjm / Observables.swift
Created Jul 3, 2020
StateObject vs. ObservableObject
View Observables.swift
// If you run this in a playground in Xcode 12, you can see the difference in behavior in the live view.
import SwiftUI
import PlaygroundSupport
class Counter: ObservableObject {
@Published var count: Int
init(_ initialCount: Int) {
self.count = initialCount
You can’t perform that action at this time.