I would like to change the value of a recursive array.

One array provides the `path` to the variable to change:

`$scopePath` represents the path to change.

For example `if $scopePath==Array("owners","products","categories")`

and $tag="price";

I would like to change `$value["owners"]["products"]["categories"]["tag"]` to `true`

```
    $u=$value;
    foreach ($scopePath as $i => $s) {
        if (!isset($u[$s]))
            $u[$s]=Array();
        $u=$u[$s];
    }
    $u[$tag]=true;

```

I know the problem is because of the line $u=$u[$s] because this changes the reference to $u, but I don't know how to fix it.
['https://Stackoverflow.com/questions/17041685', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1993501/']
Found this by accident, gives me really great (near duplicate with Apple's) results and uses the Acceleration framework. -- <http://pastebin.com/6cs6hsyQ>
\*Not written by me
Here is the Swift 2.0 code for the solution that has been provided in **accepted answer**:

```
    //only apply the blur if the user hasn't disabled transparency effects
    if !UIAccessibilityIsReduceTransparencyEnabled() {
        self.view.backgroundColor = UIColor.clearColor()

        let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.Dark)
        let blurEffectView = UIVisualEffectView(effect: blurEffect)
        //always fill the view
        blurEffectView.frame = self.view.bounds
        blurEffectView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]

        self.view.addSubview(blurEffectView) //if you have more UIViews, use an insertSubview API to place it where needed
    } else {
        self.view.backgroundColor = UIColor.blackColor()
    }

```