Question: I was currently working on an app and have made it so when I press the continue button it shows the image with a .toggle() but on the second time p press it I want it to change to a blank screen is there any way to do this or am I going to have to add a second button to change to a blank canvas.

Answer: 
You can use state pattern here.

First create `enum` with all button states

```
enum ButtonState {
    case notTapped, tappedOnce
}

```

Then create a property in a class that handle button tap

```
var buttonState: ButtonState = .notTapped

```

Now you can handle button tap in a way you want

```
@IBAction func buttonTapped(_ sender: Any) {
    switch buttonState {
    case .notTapped:
        print("do something")
        buttonState = .tappedOnce
    case .tappedOnce:
        print("do something again")
    }
}

```

You can add any states you want and handle them as you want
You can set different targets to the button according to it's state and toggle them in the action methods as shown below.

```swift
override func viewDidLoad() {
    super.viewDidLoad()
    // write your code here
    button.addTarget(self, action: #selector(ButtonTappedDuringPrimaryMode(sender:)), for: .touchUpInside)
}

@objc ButtonTappedDuringPrimaryMode(sender: UIButton) {
    // write your code here
    sender.addTarget(self, action: #selector(ButtonTappedDuringSecondaryMode(sender:)), for: .touchUpInside)
}

@objc ButtonTappedDuringSecondaryMode(sender: UIButton) {
    // write your code here
    sender.addTarget(self, action: #selector(ButtonTappedDuringPrimaryMode(sender:)), for: .touchUpInside)
}

```