Skip to content

Instantly share code, notes, and snippets.

View ipavlidakis's full-sized avatar
🏠
Working from home

Ilias Pavlidakis ipavlidakis

🏠
Working from home
View GitHub Profile
//
// Copyright © 2023 Ilias Pavlidakis. All rights reserved.
//
import Foundation
/// Provides thread-safe access to the provided value's storage
struct ThreadSafeValueAccessor<Value> {
/// Describes the access level to a value's storage. Currently supports: .read, .write
enum AccessLevel: Hashable { case read, write }
@ipavlidakis
ipavlidakis / ReusableComponentCache.swift
Created March 8, 2023 09:24
ReusableComponentCache for UITableView and UICollectionView
final class ReusableComponentCache<Element: Hashable> {
struct ReusableContainer {
let element: Element
let invalidationClosure: () -> Void
}
private var notificationCenterObserver: Any?
private var availableElements: Set<Element> = .init()
private var elementsInUse: [AnyHashable: Element] = [:]

Keybase proof

I hereby claim:

  • I am ipavlidakis on github.
  • I am ipavlidakis (https://keybase.io/ipavlidakis) on keybase.
  • I have a public key ASCoAsPBI4QcKUTcieWrY3XwkFjhiO0MA-5mF7tqxKi1tAo

To claim this, I am signing this object:

@ipavlidakis
ipavlidakis / UniversalCombine
Created December 1, 2019 19:29
Universal Combine
import Foundation
//
// UniversalCombine.swift
// UniversalCombine
//
// Created by Ilias Pavlidakis on 30/11/2019.
//
import Foundation
@ipavlidakis
ipavlidakis / mergegenstrings.py
Created November 15, 2016 10:20 — forked from yoichitgy/mergegenstrings.py
A script to generate .strings file for .swift, .m, .storyboard and .xib files by genstrings and ibtool commands, and merge them with existing translations.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Localize.py - Incremental localization on XCode projects
# João Moreno 2009
# http://joaomoreno.com/
# Modified by Steve Streeting 2010 http://www.stevestreeting.com
# Changes
# - Use .strings files encoded as UTF-8