Question: So i've been trying to get one record and edit it by pressing the button that is created in that table, but honestly, i have no idea how to do that. Dx Can anyone help me with this? (Yes, i want the button created for each record. You know, so at the end of every row in the table, every record will have it's own button.)

```
while($rArt = mysqli_fetch_array($sql)){
 echo '<tr><td>' . $rArt['ArtID'] . '</td>';
 echo '<td>' . $rArt['FiliaalID'] . '</td>';
 echo '<td>' . $rArt['Productnaam'] . '</td>';
 echo '<td>' . $rArt['Inkoopprijs'] . '</td>';
 echo '<td>' . $rArt['Voorraad'] . '</td>';
 echo '<td>' . $rArt['Min_voorraad'] . '</td>';
 $voo = $rArt['Voorraad'];
 $minvoo = $rArt['Min_voorraad'];
 $nodig = $minvoo * 2 - $voo;
 $chosen = $rArt['ArtID'];
 echo '<td>' . $nodig . '</td>';
 echo '<td><input type="submit" name="bestel" value="Bestel"></td></tr>';

 if(isset($_GET['bestel'])){
  $query = mysqli_query($mysql, "
   UPDATE artikel a, voorraad v
   SET v.voorraad = v.voorraad + '$nodig'
   WHERE a.artid = v.artid
   AND v.voorraad = '$chosen'");
 }
}

```

Answer: 
Alternatively, consider using `drawViewHierarchyInRect`:

**Swift:**

```
extension UIImage{

    class func renderUIViewToImage(viewToBeRendered: UIView) -> UIImage
    {
        UIGraphicsBeginImageContextWithOptions(viewToBeRendered.bounds.size, true, 0.0)
        viewToBeRendered.drawViewHierarchyInRect(viewToBeRendered.bounds, afterScreenUpdates: true)
        viewToBeRendered.layer.renderInContext(UIGraphicsGetCurrentContext()!)

        let finalImage = UIGraphicsGetImageFromCurrentImageContext()
        UIGraphicsEndImageContext()

        return finalImage
    }
}

```

**Objective-C:**

```
- (UIImage *)snapshot:(UIView *)view
{
    UIGraphicsBeginImageContextWithOptions(view.bounds.size, YES, 0);
    [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    return image;
}

```

Also see:

* <https://developer.apple.com/library/ios/qa/qa1817/_index.html>
* [How to capture UIView to UIImage without loss of quality on retina display](https://stackoverflow.com/questions/4334233/how-to-capture-uiview-to-uiimage-without-loss-of-quality-on-retina-display)
In my case ( XCode 7 and iOS 9 ), I use `UINavigationController` "hidden", so Ihave to add `UINavigationControllerDelegate` to present camera or roll and it work like it is supposed to! `And pickerControllerDelegate.self` doesn't display error either!