Timeline for Close iOS Keyboard by touching anywhere using Swift
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 21, 2022 at 20:50 | comment | added | javaxian | This should be the accepted answer as it doesn't interfere with other tap events. | |
Jun 10, 2019 at 15:40 | comment | added | Mohamed Salah | This doesn't work when tapping inside a tableview or any scrollable. | |
Jun 10, 2019 at 15:38 | review | Suggested edits | |||
Jun 10, 2019 at 20:59 | |||||
May 12, 2019 at 20:16 | review | Suggested edits | |||
May 12, 2019 at 23:57 | |||||
Mar 7, 2019 at 13:37 | comment | added | Bartek Spitza | This one should probably be marked as correct one. The current accepted answer makes every button in the view not responsive when keyboard is showing. | |
Dec 12, 2018 at 19:57 | comment | added | Regis St-Gelais | This is the best solution I have seen so far. Small note: in newer Swift the override signature changed a bit. You need to add _ before touches: override func touchesBegan(_ touches: Set<UITouch>, withEvent event: UIEvent?) | |
Apr 9, 2016 at 18:58 | comment | added | user3731622 | This didn't quite work for me. If I tap on the view controller's view it works. If I tap on a control item in the view, the keyboard doesn't dismiss. | |
Sep 29, 2015 at 23:25 | review | Suggested edits | |||
Sep 30, 2015 at 0:05 | |||||
S Sep 22, 2015 at 7:16 | history | suggested | crazy_phage | CC BY-SA 3.0 |
edit for swift 2.0
|
Sep 22, 2015 at 6:42 | review | Suggested edits | |||
S Sep 22, 2015 at 7:16 | |||||
Jul 1, 2015 at 22:42 | comment | added | Lukasz Czerwinski | Great piece of code, thanks! touchesBegan was exactly what I was looking for :) | |
Nov 3, 2014 at 2:27 | review | Late answers | |||
Nov 3, 2014 at 2:27 | |||||
Nov 3, 2014 at 2:09 | history | answered | King-Wizard | CC BY-SA 3.0 |