Created
October 22, 2015 12:15
-
-
Save alsedi/6c8f5f0e313ea490aa69 to your computer and use it in GitHub Desktop.
Simple Class wrapper for Swift structures. Useful for NSNotificationCenter, for example
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
// Wrapper.swift | |
// Wrap Swift structure into the class. Useful in some operations with NSFoundation classes, | |
// e.g. NSNotificationCenter.postNotificationName | |
// Gist: https://gist.github.com/alsedi/6c8f5f0e313ea490aa69 | |
class Wrapper<T> { | |
private var value: T | |
init(_ value: T) { self.value = value } | |
func unwrap() -> T { return self.value } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment