Created
May 23, 2016 07:48
-
-
Save naithar/5e87516389da0da359411c8e2100a2de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Weak.swift | |
// DDScanner | |
// | |
// Created by Sergey Minakov on 12.05.16. | |
// Copyright © 2016 Code Monkeys. All rights reserved. | |
// | |
import UIKit | |
struct Weak<T> { | |
private weak var _value : AnyObject? | |
var value: T? { | |
return self._value as? T | |
} | |
init (value: T) { | |
self._value = value as? AnyObject | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment