Re: Using protocol extension to dismiss keyboard on outside tap

2016-04-18 Thread Devarshi Kulshreshtha
Thanks, I ended doing exactly what you suggested. On Mon, Apr 18, 2016 at 10:41 PM, Quincey Morris < quinceymor...@rivergatesoftware.com> wrote: > On Apr 18, 2016, at 08:48 , Alex Kac wrote: > > > Protocol extensions are Swift only - not ObjC compatible I believe. > >

Re: Using protocol extension to dismiss keyboard on outside tap

2016-04-18 Thread Alex Zavatone
Did your view controller conform to the protocol that you established for it? You know, the little thing that goes after your @interface? ?? On Apr 18, 2016, at 4:48 AM, Devarshi Kulshreshtha wrote: > On doing that it started showing me this error: > > Type `MyViewController` does not

Re: Using protocol extension to dismiss keyboard on outside tap

2016-04-18 Thread Alex Zavatone
What if you were able to pass in a view that is the containing view that you want to receive the dismiss tap, then add an action to it to call the expected dismiss method? Hmmm, that won't work if there are other tappable items on the screen though. I just had this issue too last week, so

Re: Using protocol extension to dismiss keyboard on outside tap

2016-04-18 Thread Devarshi Kulshreshtha
On doing that it started showing me this error: Type `MyViewController` does not conform to protocol `DismissKeyboardOnOutsideTap`. On code suggestion it showed: Fix-it: Candidate is not `objc` but protocol requires it On Mon, Apr 18, 2016 at 1:59 PM, Quincey Morris <

Re: Using protocol extension to dismiss keyboard on outside tap

2016-04-18 Thread Quincey Morris
On Apr 18, 2016, at 01:07 , Devarshi Kulshreshtha wrote: > >extension DismissKeyboardOnOutsideTap { >func configureToDismissKeyboard() { >… >} > >func hideKeyboard() { >… >} > >} I think the problem

Using protocol extension to dismiss keyboard on outside tap

2016-04-18 Thread Devarshi Kulshreshtha
In my project I have few view controllers which are subclasses of UITableViewController, UIViewController, on each I want to implement this behavior: > When user taps outside of a text field it should dismiss the keyboard which was visible when user tapped inside it. I can easily implement it by