Skip to content

Instantly share code, notes, and snippets.

@bardonadam
bardonadam / Form.swift
Created December 12, 2019 08:11
Custom decode with SomeKindOfBool
struct Form: Codable, Equatable {
let id: Int
let type: FType
let name: String
let code: String
let hasScreenshot: Bool
let total: Int
let totalUnique: Int
let opened: Int
@SomeKindOfBool var active: Bool
@bardonadam
bardonadam / DynamicColor.swift
Last active August 20, 2021 03:22
DynamicColor property wrapper type to remove boilerplate code when defining dynamic colors to adopt dark mode on iOS 13
@DynamicColor(lightVariant: .black, darkVariant: .white)
static var dynamicLabelColor: UIColor
@propertyWrapper
struct DynamicColor {
let lightVariant: UIColor
let darkVariant: UIColor
var wrappedValue: UIColor {
get {

Keybase proof

I hereby claim:

  • I am bardonadam on github.
  • I am foxxy66 (https://keybase.io/foxxy66) on keybase.
  • I have a public key ASB7o7msjdp62QS0MLfk3CBtHNktRxc-eyRglrzwtso4wwo

To claim this, I am signing this object: