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 | |
@propertyWrapper | |
struct StringRepresentation<T: LosslessStringConvertible> { | |
private var value: T? | |
var wrappedValue: T? { | |
get { | |
return value | |
} |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
extension Array { | |
private var x:Element? { return self.first } | |
private var xs: [Element] { return [Element](self.dropFirst()) } | |
var parts: (Element?, [Element]) { | |
return (self.x, self.xs) | |
} |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
import PlaygroundSupport | |
protocol IDataTemplate { | |
associatedtype Item | |
associatedtype Cell: UITableViewCell | |
func register(tableView: UITableView) | |
func configuredCell(tableView: UITableView, for indexPath: IndexPath, with item: Item) -> Cell |