If you're confused about how to set the CGFloat values in an init function, you could do something like this:
class myNewClass
{
var calc : [[CGFloat]] = [[77, 53, 223, 53, 77, 247, 223, 247],[63, 34, 237, 34, 63, 265, 237, 265]]
init(index:Int, value:CGFloat...)
{
calc[index] = value
}
}
If you then instantiate myNewClass with:
let newClass:myNewClass = myNewClass(index: 0, value: 1, 2, 3)
Then later say:
println(newClass.calc.count)
println(newClass.calc[0])
This would print:
2
[1.0, 2.0, 3.0]
If, during initialization, you want to add an element, you would of course use append.
Edit:
If all you want to do is associate your CGFloat arrays with particular images, you could use a dictionary and you don't really need to create a separate class to do it.
If, for example, I put the following line in my appDelegate file, but outside of (above) any class
var calcDict:[String:[CGFloat]] = ["image1.jpg": [77, 53, 223, 53, 77, 247, 223, 247], "image2.jpg":[63, 34, 237, 34, 63, 265, 237, 265]]
Because it's declared outside of any class, it's now visible from anywhere in your code.
If then, somewhere else in my code I write:
var myCGFloats = calcDict["image1.jpg"]!
println(myCGFloats)
calcDict["image3.jpg"] = [1, 2, 3]
myCGFloats = calcDict["image3.jpg"]!
println(myCGFloats)
This prints:
[77.0, 53.0, 223.0, 53.0, 77.0, 247.0, 223.0, 247.0]
[1.0, 2.0, 3.0]
The return from a dictionary lookup is an optional type, so I put an ! after each of the myCGFloats = statements to unwrap the value returned from the dictionary.
If you want to declare calcDict in your view controller class you could also do that. Inside your view controller class (let's call it MyViewController), but outside of any function (like init()) all you need to have is:
var calcDict:[String:[CGFloat]] = ["image1.jpg": [77, 53, 223, 53, 77, 247, 223, 247], "image2.jpg":[63, 34, 237, 34, 63, 265, 237, 265]]
This creates an instance variable. You could then access calcDict directly from inside your view controller, or if you have instantiated your view controller as:
myViewController = MyViewController()
then from anywhere in your code where myViewController is visible you could access calcDict as:
var myCGFloats = myViewController.calcDict["image1.jpg"]!