Skip to content

Instantly share code, notes, and snippets.

View bennyscripts's full-sized avatar
🤯
benny.fun

ben bennyscripts

🤯
benny.fun
  • United Kingdom
  • 05:54 (UTC +01:00)
View GitHub Profile
@norsez
norsez / JSONSaveLoad.swift
Created May 7, 2018 04:47
Load and Save JSON objects into a local file (written in Swift)
import Foundation
/**
Extension to save/load a JSON object by filename. (".json" extension is assumed and automatically added.)
*/
extension JSONSerialization {
static func loadJSON(withFilename filename: String) throws -> Any? {
let fm = FileManager.default