Skip to content

Instantly share code, notes, and snippets.

View oaleeapp's full-sized avatar

Victor Lee oaleeapp

View GitHub Profile
import Foundation
extension Dictionary {
mutating public func setValue(value: Any, forKeyPath keyPath: String) {
var keys = keyPath.components(separatedBy: ".")
guard let first = keys.first as? Key else { print("Unable to use string as key on type: \(Key.self)"); return }
keys.remove(at: 0)
if keys.isEmpty, let settable = value as? Value {
self[first] = settable
} else {
@oaleeapp
oaleeapp / transparentNavBar.swift
Created April 23, 2020 12:15
Transparent Nav Bar
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
let navigationBar = self.navigationController?.navigationBar
navigationBar?.tintColor = UIColor.ColorTheme.defaultTheme.backgroundColor
navigationBar?.setBackgroundImage(UIImage(), for: .default)
navigationBar?.shadowImage = UIImage()
navigationBar?.isTranslucent = true
navigationBar?.backgroundColor = .clear
}