Skip to content

Instantly share code, notes, and snippets.

@fxm90
fxm90 / Dictionary+MapKeys.swift
Created June 14, 2021 07:31
Counterpart methods to `mapValues(_:)` and `compactMapValues(_:)`
//
// Dictionary+MapKeys.swift
//
// Created by Felix Mau on 14.06.21.
// Copyright © 2021 Felix Mau. All rights reserved.
//
extension Dictionary {
/// Returns a new dictionary containing the keys transformed by the given closure.
/// The values of this dictionary stay the same.
@fxm90
fxm90 / SwiftUI+HTML.swift
Created June 28, 2021 14:43
Extension that converts Strings with basic HTML tags to SwiftUI's Text (Supports SwiftUI 3.0 / iOS 15.0).
//
// SwiftUI+HTML.swift
//
// Created by Felix Mau on 28.05.21.
// Copyright © 2021 Felix Mau. All rights reserved.
//
import SwiftUI
@available(iOS 15.0, *)