Skip to content

Instantly share code, notes, and snippets.

@casperzandbergenyaacomm
casperzandbergenyaacomm / ArrowImageGenerator.swift
Last active November 13, 2018 11:15 — forked from ale84/ArrowImageGenerator.swift
Helper class to generate simple arrows images of desired size, colour and direction using UIKit api.
//
// ArrowImageGenerator.swift
//
// Created by Alessio Orlando on 07/10/15.
// Copyright © 2015 Alessio Orlando. All rights reserved.
//
import Foundation
import UIKit
@casperzandbergenyaacomm
casperzandbergenyaacomm / DictionaryKeyPath.swift
Last active June 14, 2021 11:16 — forked from dfrib/DictionaryKeyPath.swift
Swift: Reading and writing to (possible) nested dictionaries for a given key path, using a recursive approach
// Inspired by: https://gist.github.com/dfrib/d7419038f7e680d3f268750d63f0dfae
import Foundation
extension Dictionary {
subscript(keyPath string: String) -> Value? {
get {
return self[keyPath: Dictionary.keyPath(for: string)]
}
set {
self[keyPath: Dictionary.keyPath(for: string)] = newValue