Mapping array works in playground but not in Xcode project

75 Views Asked by At

I am attempting to perform a simple mapping from one array into another.

It works perfectly in the playground, but fails in Xcode.

import UIKit

class ViewController: UIViewController, UITableViewDelegate {
    let multiplicand = [1,2,3]
    var multiplier: Int = 3
    var product = multiplicand.map({$0 * multiplier})

The error message is on the last line

'ViewController Type' does not have a member named 'multiplicand'

Swift 2.0

Xcode 7 beta 3

0

There are 0 best solutions below