-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathController.swift
40 lines (32 loc) · 920 Bytes
/
Controller.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// Controller.swift
// Splatter
//
// Created by Martino Giacchetti on 06/12/14.
// Copyright (c) 2014 HCI_assignment. All rights reserved.
//
import Cocoa
class Controller: NSView {
var listOfShapes = [Shape]()
override func drawRect(dirtyRect: NSRect) {
super.drawRect(dirtyRect)
}
required init?(coder: NSCoder) {
super.init(coder: coder)
for index in 1...9 {
var newShape = Shape()
newShape.setShape(index)
listOfShapes.append(newShape)
addSubview(newShape)
newShape.display()
newShape.setFrameOrigin(CGPointMake(100, 100))
newShape.setFrameSize(CGSizeMake(100, 100))
}
}
override func mouseDragged(theEvent: NSEvent) {
// println("mouse dragged")
}
override func keyDown(theEvent: NSEvent) {
println("key event")
}
}