UA-17470720-3

Jump to content


Photo
- - - - -

willSelect willDeselect issues


  • Please log in to reply
9 replies to this topic

#1 jamesdterry

jamesdterry

    Starting Out

  • STV 4.0 Pro
  • Pip
  • 4 posts
Reputation: 1
Good

Posted 18 June 2014 - 07:03 AM

I am using the willSelect and willDeselect to trigger pre and post processing on cell values.  These action are not called when a user switches fields by tapping on the cell itself or uses the keyboard accessory previous and next buttons.  The action are called when a user taps on the field label to switch fields.  Is this by design or a bug?  Seem like it should be a bug.  Thanks in advance for any help.


  • Tarek likes this

#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 19 June 2014 - 01:02 AM

Hi James,

 

This is actually by design, since selecting the cell's UITextField isn't technically selecting the cell itself. However, you actually might have a point here. Would you please let me know of the kind of functionality you're trying to achieve? Thanks!



#3 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 19 June 2014 - 01:06 AM

To further illustrate the point of my question, you might be able to achieve the functionality you need by using cellActions.valueChanged instead of willSelect and willDeselect.



#4 jamesdterry

jamesdterry

    Starting Out

  • STV 4.0 Pro
  • Pip
  • 4 posts
Reputation: 1
Good

Posted 19 June 2014 - 09:39 AM

Thanks Tarek for your reply.  I have a data collection app that needs to adjust the fields presented to the user (and other attributes) when the user is finished with a cell.  For example, if the user is entering a salary into a field and the value is less than some minimum we'll want to add additional fields asking for other sources of income.  The valueChanged action gets called as the user is entering each character and I'd like to only make the change to the collection form when they are done with the cell.  Basically I need an action when a cell becomes active and when one become inactive, so I can make adjustments to the form at precisely that time.



#5 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 19 June 2014 - 12:30 PM

Yes you're right, it does make a lot of sense to add cellActions.didBecomeFirstResponder and cellActions.didResignFirstResponder.

 

Is this an urgent matter for you, or are you able to wait until we add this feature to our upcoming STV 4.0 release? (which will be out in about 3 months)

 

Thanks again for all your feedback.



#6 jamesdterry

jamesdterry

    Starting Out

  • STV 4.0 Pro
  • Pip
  • 4 posts
Reputation: 1
Good

Posted 19 June 2014 - 12:44 PM

It is for a project I need to deliver within 2-3 weeks.



#7 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 20 June 2014 - 04:15 PM

Ok done. Our latest STV 3.4.1 release adds the new didBecomeFirstResponder and didResignFirstResponder actions. Here are simple examples of how to use them (official documentation will be updated with the STV 4.0 major release)

 

cellActions.didBecomeFirstResponder = ^(SCTableViewCell *cell, NSIndexPath *indexPath)
{
        NSLog(@"Cell at indexPath:%@ has become the first responder.", indexPath);
};
 
cellActions.didResignFirstResponder = ^(SCTableViewCell *cell, NSIndexPath *indexPath)
{
        NSLog(@"Cell at indexPath:%@ has resigned the first responder.", indexPath);
};

 

Hope this helps.


  • Everett, ozie and wizgod like this

#8 jamesdterry

jamesdterry

    Starting Out

  • STV 4.0 Pro
  • Pip
  • 4 posts
Reputation: 1
Good

Posted 23 June 2014 - 07:13 AM

Awesome, thanks so much Tarek, I will try it out now.



#9 Andy Drexler

Andy Drexler

    Jr. Member

  • STV 5.0 Pro
  • PipPip
  • 17 posts
Reputation: 2
Good

Posted 20 August 2014 - 10:08 AM

I was just madly searching for this functionality - it works great!! Thanks!!!


  • Tarek likes this

#10 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 20 August 2014 - 01:10 PM

Glad you guys found it helpful! :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users