Skip to content

Instantly share code, notes, and snippets.

View reyandrey's full-sized avatar

Andrey Fokin reyandrey

  • Saint Petersburg, Russia
View GitHub Profile
@reyandrey
reyandrey / MacEditorTextView.swift
Created September 26, 2020 03:17 — forked from unnamedd/MacEditorTextView.swift
[SwiftUI] MacEditorTextView - A simple and small NSTextView wrapped by SwiftUI.
/**
* MacEditorTextView
* Copyright (c) Thiago Holanda 2020
* https://twitter.com/tholanda
*
* MIT license
*/
import Combine
import SwiftUI
@reyandrey
reyandrey / decode-json-swift.swift
Created March 23, 2020 20:41 — forked from mikebuss/decode-json-swift.swift
Decode [Any] and [String: Any] Swift 4
//
//
// Adapted from:
//
// Original: https://gist.github.com/loudmouth/332e8d89d8de2c1eaf81875cfcd22e24
// Adds encoding: https://github.com/3D4Medical/glTFSceneKit/blob/master/Sources/glTFSceneKit/GLTF/JSONCodingKeys.swift
// Adds fix for null inside arrays causing infinite loop: https://gist.github.com/loudmouth/332e8d89d8de2c1eaf81875cfcd22e24#gistcomment-2807855
//
struct JSONCodingKeys: CodingKey {
var stringValue: String