I hereby claim:
- I am markiv on github.
- I am krips (https://keybase.io/krips) on keybase.
- I have a public key ASAKJil3iYQZB9JTkiKN9znoKe5RRyc1eOCy5pkcfaCkIgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import Foundation | |
extension URLComponents { | |
/// Abstracts away URLComponentโs array of URLQueryItems into a simple dictionary | |
var parameters: [String: CustomStringConvertible] { | |
get { | |
return queryItems?.reduce(into: [String: String]()) { $0[$1.name] = $1.value } ?? [:] | |
} | |
set { | |
queryItems = newValue.map { URLQueryItem(name: $0.key, value: String(describing: $0.value)) } |
extension KeyedDecodingContainer { | |
func lenientDecode<T>(_ type: T.Type, forKey key: KeyedDecodingContainer.Key) throws -> T where T: Decodable & LosslessStringConvertible { | |
do { | |
return try decode(T.self, forKey: key) | |
} catch { | |
guard let stringValue = try? decode(String.self, forKey: key), let t = T(stringValue) else { throw error } | |
return t | |
} | |
} | |
} |
extension URL { | |
typealias ComponentsManipulator = (inout URLComponents) -> () | |
func manipulate(with manipulator: ComponentsManipulator) -> URL { | |
guard var components = URLComponents(url: self, resolvingAgainstBaseURL: true) else { return self } | |
manipulator(&components) | |
return components.url ?? self | |
} | |
/// Deletes first path component after the initial slash |
// | |
// ContentView.swift | |
// QuantityStepper | |
// | |
// Created by Vikram Kriplaney on 07.11.2019. | |
// Copyright ยฉ 2019 iPhonso GmbH. All rights reserved. | |
// | |
import SwiftUI |
import Foundation | |
extension String.StringInterpolation { | |
fileprivate static let myMeasurementFormatter: MeasurementFormatter = { | |
let this = MeasurementFormatter() | |
this.unitOptions = [.naturalScale] | |
this.numberFormatter.maximumFractionDigits = 1 | |
return this | |
}() | |
mutating func appendInterpolation<UnitType>(_ measurement: Measurement<UnitType>) where UnitType: Unit { |
[ | |
{ | |
"title": "Contovista Result 1", | |
"summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", | |
"confidence": 0.75, | |
"provider": "Contovista", | |
"url": "banking://contovista/overview" | |
}, | |
{ | |
"title": "Contovista Result 1", |
struct FloatingTextField: View { | |
let title: String | |
let text: Binding<String> | |
var body: some View { | |
VStack(alignment: .leading, spacing: 2) { | |
Text(title) | |
.font(.caption) | |
.foregroundColor(Color(.placeholderText)) | |
TextField(title, text: text) |
struct FloatingTextField: View { | |
let title: String | |
let text: Binding<String> | |
var body: some View { | |
VStack(alignment: .leading, spacing: 2) { | |
Text(title) | |
.font(.caption) | |
.foregroundColor(Color(.placeholderText)) | |
.opacity(text.wrappedValue.isEmpty ? 0 : 1) |