Skip to content

Instantly share code, notes, and snippets.

View aplr's full-sized avatar

Andreas Pfurtscheller aplr

View GitHub Profile
# The whitelist_rules configuration also includes rules that are enabled by default to provide a good overview of all rules.
only_rules:
- attributes
- anyobject_protocol
# Prefer using AnyObject over class for class-only protocols.
- array_init
# Prefer using Array(seq) over seq.map { $0 } to convert a sequence into an Array.
- block_based_kvo
# Prefer the new block based KVO API with keypaths when using Swift 3.2 or later.
- class_delegate_protocol
@aplr
aplr / Publisher+Unwrap.swift
Last active August 29, 2022 02:36
A combine operator for transforming unwrapped values and passing along nil values
protocol OptionalType {
associatedtype Wrapped
var value: Wrapped? { get }
}
extension Optional: OptionalType {
public var value: Wrapped? {
return self
}
}

Keybase proof

I hereby claim:

  • I am aplr on github.
  • I am aplr (https://keybase.io/aplr) on keybase.
  • I have a public key ASANXli5HGbTExd1vIM7O1j2HaH4zc6Y2kcZ-63To5FcFwo

To claim this, I am signing this object: