Skip to content

Instantly share code, notes, and snippets.

View photovirus's full-sized avatar

Yakov Shapovalov photovirus

View GitHub Profile
@christianselig
christianselig / milkshake.swift
Last active March 20, 2021 11:37
A beautiful milkshake where the ingredients are Sean Heber, Yakov Shapovalov, and Hunter Meyer.
/// 🥤
extension Dictionary where Key: RawRepresentable {
func rawConversion<NewKey>() -> Dictionary<NewKey, Value> where NewKey == Key.RawValue {
let newDict: [NewKey: Value] = self.reduce(into: [:]) { (result, item) in
result[item.key.rawValue] = item.value
}
return newDict
}
}