Skip to content

Instantly share code, notes, and snippets.

View mxswd's full-sized avatar

Maxwell mxswd

View GitHub Profile
@mxswd
mxswd / ViewController.swift
Created March 10, 2022 07:54
Persisting stuff. In the MyModel.xcdatamodel make an Entity called MyThingEntity, an attribute index with type int32, an attribute data with type Data. Give the entity a constraint on the index.
import UIKit
import CoreData
public struct MyThing: Codable {
var state: Bool? = nil
var value: String? = nil
}
class ViewController: UIViewController, UITextViewDelegate {