swift uiview add tap gesture
let tap = UITapGestureRecognizer(target: self, action: #selector(self.handleTap(_:)))
myView.addGestureRecognizer(tap)
// Then, you should implement the handler, which will be called each time when a tap event occurs:
@objc func handleTap(_ sender: UITapGestureRecognizer? = nil) {
// handling code
}
Also in Swift:
- swift 5 only the day number from date
- button image not working swiftui
- how to dismiss keyboard swiftui
- dequeueReusableCellWithIdentifier returns nil
- swift animate a label ishidden
- ui alert swift yes no
- add navigation bar button swiftui
- xcode enable a button after a text field is filled
- get device height spritekit
- swift textfield trim special characters before database
- swift quit app
- swift get slected row data in tableview cell
- round up swift
- show alert swiftui
- ios rounded button
- dictionary in swift
- convert string to base64 swift
- ShareSheet: UIViewControllerRepresentable swiftui
- swift assign tuple to variables
- join arrays swift
- hide status bar in tableview cell in swift
- text field passing data
- how to set the font of text in swiftui
- register page