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
struct HashTable<Key: Hashable, Value> { | |
private typealias Element = (key: Key, value: Value) | |
private typealias List = LinkedList<Element> | |
private var table: [List] | |
init(size: Int) { | |
table = Array<List>() | |
for _ in 0..<size { |
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
extension UIView { | |
func addDashedBorder() { | |
let color = UIColor.black.cgColor | |
let shapeLayer:CAShapeLayer = CAShapeLayer() | |
let frameSize = self.frame.size | |
let shapeRect = CGRect(x: 0, y: 0, width: frameSize.width, height: frameSize.height) | |
shapeLayer.bounds = shapeRect | |
shapeLayer.position = CGPoint(x: frameSize.width/2, y: frameSize.height/2) |
OlderNewer