About @objc and exposing to the objective-C

Why can’t I change this? I can’t not to add @objc and can’t not to expose the method to the objective-C.

What you are presenting is an Alert rather than an ActionSheet. If this is related to an earlier question you had regarding creating a button like this:

and then presenting a list of options like this:

IMG_4766

…then you don’t need a tap Gesture Recogniser if you have a Button configured. When the user taps the button, your code can call the showActionSheet() and then take action after the user selects one of the options listed.

How to create such Button?
And I misunderstood how can It be one or some finite number of Buttons if this button is from the site which is displayed on the WebView, how can you explain me why is this the case?
The situation is:

  1. I create a Web View without any buttons on it
  2. On the Web View I display some web browser
  3. I go to some website(via this browser) where there are some video players with the play Buttons
    How can I use the last type of Buttons?

Are you looking for something like this?

May be. If it would display only if I open a site in the web view. But on my suitable view controller there is no label “Main View” and no such small button behind the label.

The rest of the ViewController is one that I have been using to test other stuff. Ignore all the other elements. Is the button I was tapping on what you were looking for?

Yes. Its what I am looking for.

I created that button image using Photoshop with the color white on a transparent background. You could just as easily create the same using Sketch. The advantage of using Sketch is that you can export them in the correct sizes to add to your asset catalogue.

For the example project I used the full sized image in Storyboard as a background image for the Button and then resized it to 100 x 100 and set the ContentMode to Aspect Fit

This is the image:

I configured an IBAction from Storyboard to my ViewController and inside that I added
code to call the showAlert function and then configured the alert similar to yours

    @IBAction func playButtonTapped(_ sender: Any) {
        showCustomAlert()
    }
    
    func showCustomAlert() {
        let alert = UIAlertController(title: nil, message: nil, preferredStyle: .alert)
        let cancel = UIAlertAction(title: "Cancel", style: .cancel) { (action) in
            print("Cancel selected")
        }
        let download = UIAlertAction(title: "Download", style: .default) { (action) in
            print("Download selected")
        }
        let later = UIAlertAction(title: "Later", style: .default) { (action) in
            print("Later selected")
        }
        
        alert.addAction(download)
        alert.addAction(later)
        alert.addAction(cancel)
        
        present(alert, animated: true, completion: nil)
    }

And this button should not display if I do not open the WEB-SITE with a video player and do not open some video player in browser. I.e no connections of some button from storyboard to the view controller as in the App Video Saver.

You would need to setup code to only allow the button to be visible when there is a video in the browser. I really don’t know how you are going to do that but that is up to you to figure out.

What are you trying to do? Are you trying to create an App that will detect a video in the browser and then download it?

I don’t try anything. Only for the interest I have started learning iOS Programming and swift language, and Xcode, cause even I have no 99$ for getting apple developer program. That’s why am asking always some possibly strange questions. Possibly I will make some iOS App in the future when I have minimally 99$ and no any problems which I can solve only with some money. But thank’s for the idea.