uiimageview add tap gesture swift
override func viewDidLoad()
{
super.viewDidLoad()
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(imageTapped(tapGestureRecognizer:)))
imageView.isUserInteractionEnabled = true
imageView.addGestureRecognizer(tapGestureRecognizer)
}
@objc func imageTapped(tapGestureRecognizer: UITapGestureRecognizer)
{
let tappedImage = tapGestureRecognizer.view as! UIImageView
// Your action
}
Also in Swift:
- Close iOS Keyboard by touching anywhere using Swift
- uicolor from hex swift
- swift stirng to date
- swift table view needs
- convert dictionary to array swift
- how to change the font of buttons programmatically swift
- how to get index path cell collection view from ui longpress gesture swift
- how can i find range of a string in another string swift
- register page
- uilabel center text programmatically swift
- create protocol swift
- swift for loop index
- swift zstack
- disable dark mode swift
- run a function only once swift
- array of button listeners swift
- parse int in swift
- detect binding valu change swiftui
- use timer swift
- conert data to string swift
- textchange in textview swift
- swift VStack
- add textfield in swiftui
- swift apply changes after a word in string