Question: I have made a loading screen (splash screen) just like the old C64. 

I have used a series of picture boxes and just change the coloured image using a timer and a case statement.

```
switch (a)
{
    case 1: 
        pictureBox1.Image = Properties.Resources.image1;
        pictureBox8.Image = Properties.Resources.image1;
        pictureBox10.Image = Properties.Resources.image1;
        pictureBox2.Image = Properties.Resources.image1;
        pictureBox11.Image = Properties.Resources.image1;
        pictureBox9.Image = Properties.Resources.image1;
        break;
    case 2:
        pictureBox1.Image = Properties.Resources.image2;
        pictureBox8.Image = Properties.Resources.image2;
        pictureBox10.Image = Properties.Resources.image2;
        break;
    case 3:
        pictureBox1.Image = Properties.Resources.image3;
        pictureBox8.Image = Properties.Resources.image3;
        pictureBox10.Image = Properties.Resources.image3;
        break;
    case 4:
        pictureBox1.Image = Properties.Resources.image4;
        pictureBox8.Image = Properties.Resources.image4;
        break;
    case 5:
        pictureBox1.Image = Properties.Resources.image5;
        pictureBox8.Image = Properties.Resources.image5;
        break;
    case 6:
        pictureBox1.Image = Properties.Resources.image6;
        pictureBox8.Image = Properties.Resources.image6;
        break;
    case 7:
        pictureBox1.Image = Properties.Resources.image7;
        pictureBox8.Image = Properties.Resources.image7;
        break;
    case 8:
        pictureBox1.Image = Properties.Resources.image8;
        pictureBox8.Image = Properties.Resources.image8;
        break;
}

```

its a bit nasty looking, how could I improve my code?

Answer: 
I think I've cracked it and post this if it helps others. This [SO post](https://stackoverflow.com/questions/3996425/cameraoverlayview-buttons) was the clue.

The problem was the button on the cameraOverlay on the UIImagePickerController showed on-screen, but didn't register touches. As @Dia Kharrat noted in that post, 'the overlay UIView's frame was not large enough. The clipsToBounds property for a UIView is by default set to NO, which means its subviews are still visible even if they are outside the parent's frame... essentially, make sure your overlay's frame is large enough, or that your subviews of the overlay are positioned within its bounds.' I had placed button outside overlay - but it was still showing.

I added `overlayView.clipsToBounds = true` to test and the button disappeared on running, proving comment above. So solution is to define the initial picker frame as full screen size, adding code:

```
let screenSize = UIScreen.mainScreen().bounds.size // line moved to top of code
let pickerFrame = CGRectMake(0,0,screenSize.width,screenSize.height) // Full screen size

```

The rest of code above remains unchanged. Now buttonAction does get called. Thanks for help @TroyT and @Fr4nc3sc0NL.
Maybe you have to add `@IBAction` in front of `func buttonAction(sender: UIButton!)`