Skip to content

Instantly share code, notes, and snippets.

@mwrites
Created February 28, 2018 08:52
Show Gist options
  • Save mwrites/a01eff9bb5bcc9ea3587cd2915fb8707 to your computer and use it in GitHub Desktop.
Save mwrites/a01eff9bb5bcc9ea3587cd2915fb8707 to your computer and use it in GitHub Desktop.
CustomCollection Description
public struct Queue<T> : CustomStringConvertible where T : CustomStringConvertible {
fileprivate var array = [T]()
public var description: String {
var desc: String = ""
desc = array.reduce(into: desc) {
$0 += $1.description + "\n"
}
return desc
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment