Skip to content

Instantly share code, notes, and snippets.

Mohamed Afifi mohamede1945

Block or report user

Report or block mohamede1945

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mohamede1945
mohamede1945 / Cache.swift
Created May 4, 2017
NSCache wrapper that works with Swift structs
View Cache.swift
private class ObjectWrapper {
let value: Any
init(_ value: Any) {
self.value = value
}
}
private class KeyWrapper<KeyType: Hashable>: NSObject {
let key: KeyType
@mohamede1945
mohamede1945 / Cache.swift
Last active Sep 1, 2017
General purpose Cache for Swift, No AnyObject restrictions! Can be used with Structs
View Cache.swift
extension Hashable {
var hashNumber: NSNumber {
return NSNumber(value: hashValue)
}
}
private class ObjectWrapper {
let value: Any
init(_ value: Any) {
View ProgrammerAssertions.swift
//
// ProgrammerAssertions.swift
// Assertions
//
// Created by Mohamed Afifi on 12/20/15.
// Copyright © 2015 mohamede1945. All rights reserved.
//
import Foundation
You can’t perform that action at this time.