Skip to content

Instantly share code, notes, and snippets.

@lukaskukacka
lukaskukacka / Synchronized.swift
Last active May 12, 2019 20:20
Simple Swift generic wrapper class giving synchronized (threadsafe) access to an instance (Swift 5)
// Swift Playground
import Foundation
import Dispatch
final class Synchronized<T> {
private let queue: DispatchQueue
private var _value: T
init(_ value: T) {
@lukaskukacka
lukaskukacka / KeychainDumper.m
Last active September 18, 2023 17:22
Keychain dumper (Obj-C). Prints all values from iOS Keychain.
@interface KeychainDumper: NSObject
- (void)dumpVerbose:(BOOL)verbose;
@end
@implementation KeychainDumper
- (void)dumpVerbose:(BOOL)verbose {
[self printString:@"##################################################################"];
[self printString:@"### KEYCHAIN DUMP ################################################"];
[self printString:@"##################################################################"];