I like to change an array value for my function call.
Code for my ViewController2 that calls a function calculate
class ViewController2: UIViewController , UITableViewDelegate, UITableViewDataSource {
var springDisplacement : [Float] {return calculate(forceView2, stiffView2, springNumView2) }
}
Code for function calculate
public func calculateBoundary (f:[Float], s:[Float], n:NSInteger) -> (forceBound1:Float, forceBound2: Float, displacement:[Float]) {
println("\nForces in the array are")
for rows in 0...n{
if(rows==0||rows==n)
{ f[rows] = 0.0 }
println(f[rows])
}
}
I have an error: '@lValue $T5' is not identical to 'Float', when i want to change my f[rows] = 0.0
Any advices?