I have a top bar navigation with a search icon (image 1), i want to be able to click this icon and to have a overlay search screen pop up (image 2 & 3). I am new to swift so I'm not quite sure how to do this.

The code below is what I have so far to create the search icon.

But not sure where to go from here, I can't seem to find anything that can help me figure this out. Help would be very much appreciated.

Many thanks

<https://i.stack.imgur.com/OXeT2.png>

<https://i.stack.imgur.com/FskZS.png>

<https://i.stack.imgur.com/m3Xto.png>

```
private func setupRightNavItems() {

    let searchButton = UIButton(type: .system)
    searchButton.setImage(#imageLiteral(resourceName: "search_icon").withRenderingMode(.alwaysOriginal), for: .normal)
    searchButton.frame = CGRect(x: 0, y: 0, width: 25, height: 25)
    navigationItem.rightBarButtonItem = UIBarButtonItem(customView: searchButton)

}

```