Created
October 21, 2020 00:46
-
-
Save chrismsimpson/19b5794166cb2b81c3eaf5903c239724 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
import Foundation | |
public func cast<T>(from any: Any?) -> T { | |
guard let type = any as? T else { | |
fatalError() | |
} | |
return type | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment