ios - Touch Down does not perform action it is supposed to -


I'm trying to move an autocomplete tableview, so this field will touch the lower limit of the user , Is currently typing in it. Do this, I do some calculation, then run on the related fields on the touch down.

There are 3 outlet variables, 2 fields and a table view:

  @IBotletY Table Refresh: UITABLE VISUES! @Ibotatlet weak countries separateField: UITfixfield! @IBotletlet Weak Category CountryFieldWire 2: UITfixField!  

Here are the variables ....

  on field1YBottomCoordinate = 0 on tableXCenter = 0 on tableYCenter = 0 on field2YBottomCoordinate = 0 on differenceBetweenY = 0  

.... that I set in viewDidLoad:

  field1YBottomCoordinate = int (CGRectGetMinY (countriesFieldVar.frame)) tableXCenter = int (CGRectGetMidX (tableRefresh.frame) ) TableYCenter = int (CGRectGetMidY) (tableRefresh.frame) field2YBottomCoordinate = int (CGRectGetMinY (countriesFieldVar2.frame)) differenceBetweenY = int (field2YBottomCoordinate - field1YBottomCoordinate)  

Then, on bottom + 1 countriesFieldVar2 However, I do this to move the tableRefresh to the desired location:

  @IBAction function coutriesFiel D2SetSelect (this: AnyObject) {tableRefresh.center = CGPoint (X: tableXCenter, Wi: (tableYCenter + differenceBetweenY)}}  

The problem is that countries on the first touch on the FieldVar2 area, some Does not happen. Or to be correct, I briefly see the keyboard as a wink in the desired place, while the keyboard goes up, then the table goes back exactly where it was. It is only on the other end in the field, I get the desired steps. Why is it like this ? (Fast use)

Here are some codes that force a retry with a timer and a bool To work

  aTimer = [NSTimer scheduledTimerWithTimeInterval: .5 target: self selector: @selector (TRYAGAIN) userInfo: repeats not equal to: yes]; - (zero) tryAgain {if (checkball) {[Press the button itself:]; }} - (IBAction) button pressed: (ID) Sender {// First Please enter the code check Bool = YES; [Atom invalid]; }  

Comments