ios - Swift calling public class in another file -
In swift programming, I have created a public class called Array 3D and it's inside the Array3d.swift file.
My ViewController2.swift is called a variable by using Array3d class and i println (dog). Although my console does not show the values of the dog's array, but instead show FYP_Table.Array3D.
I have called a 3D Aare to the dog and put some values in it. Now I want to print it on my debugger output. But does not work
// array 3D Soft Public Class Array 3D {var zs: Int, YS: IT, XS: IIT Matrix: [Float] Init (JS: IT, YS: IT, XS: IT) {Self.zs = zs self.ys = ys self .xs = xs matrix = array (count: zs * ys * xs, duplicateview: 0)} subscript (z: int, y: int, x: int) - & gt; Float {return matrix {z * ys * xs + y * xs + x}} set {matrix [z * ys * xs + y * xs + x] = newValue}} // visual controller 2.swift class ViewController2: UITableViewController {Var Dog = Array3D (zs: 3, ys: 3, xs: 3) Override funk viewDidload () {dog [1,0,0] = 1 dog [0,4,0] = 2 dog [0,0,4] = 3 dogs in [0,4,4] = 4 for z ..
Your class has no description This is printing only the default presentation.
Function Details () - & gt; String {return string (format: "array 3d js:% d ys:% d xs:% d", owns .zs, self.ys, self.zs}}
Comments
Post a Comment