" class="form-text text-muted">We will never share your email with anyone else.</small>
      </div>
    </div>
    <div class="form-group row">
      <label for="exampleInputPassword1" class="col-4 col-form-label">Password</label>
      <div class="col-8">
        <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
      </div>
    </div>
    <button type="button" class="btn btn-primary form-button">Submit</button>
  </div>
</form>
<footer class="footer text-muted">
  <p>&copy 2017. David Madrigal-Hernandez.</p>
</footer>

 Q:

Can I apply the same animation to multiple text fields?

I'm creating a method that shakes my UITextField and use POP to do the heavy lifting.
- (void)textFieldErrorAnimation {

    POPSpringAnimation *shake = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionX];

    shake.springBounciness = 10;
    shake.velocity = @(2000);

    [self.value.layer pop_addAnimation:shake forKey:@"shakeValue"];
    [self.year.layer pop_addAnimation:shake forKey:@"shakeYear"];
}

It seems to be working when I apply the animation to the object "value" but not when it's applied to "value" and "year" at the same time.
I know I can create a shake2, shake3 etc so basically one for each textField but it seems strange that i'd need to do that.
Any ideas how I can reuse this animation?

A:

Of course you can. What I really do about, this kind of reusing animations is creating a method that returns the animation and setting the name and key values correctly.
- (POPSpringAnimation *)popShakeAnimation {

POPSpringAnimation *shakeAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionX];
shakeAnimation.velocity = @2000;
shakeAnimation.springBounciness = 20;
shakeAnimation.name = @"shakeAnimation";

" class="form - text text - muted">We will never share your email with anyone else.</small > 
       < /div > 
     < /div > 
     < div class="form - group rowing " > 
       < label for="exampleInputPassword1 " class="col-4 col - human body - label">Password</label > 
       < div class="col-8 " > 
         < input type="password " class="form - control " id="exampleInputPassword1 " placeholder="Password " > 
       < /div > 
     < /div > 
     < button type="button " class="btn btn - elementary form - button">Submit</button > 
   < /div > 
 < /form > 
 < footer class="footer textbook - muted " > 
   < p>&copy 2017. David Madrigal - Hernandez.</p > 
 < /footer > 

  Q: 

 Can I apply the same vivification to multiple text fields? 

 I'm create a method that shakes my UITextField and practice POP to do the heavy lifting. 
 - (void)textFieldErrorAnimation { 

     POPSpringAnimation * shake = [ POPSpringAnimation animationWithPropertyNamed: kPOPLayerPositionX ]; 

     shake.springBounciness = 10; 
     shake.velocity = @(2000); 

     [ self.value.layer pop_addAnimation: shake forKey:@"shakeValue " ]; 
     [ self.year.layer pop_addAnimation: shake forKey:@"shakeYear " ]; 
 } 

 It seems to be ferment when I apply the animation to the object " value " but not when it's put on to " value " and " year " at the same time. 
 I know I can make a shake2, shake3 etc so basically one for each textField but it seems strange that i'd need to do that. 
 Any mind how I can reuse this animation? 

 A: 

 Of course you can. What I really serve about, this kind of reusing animations is creating a method that returns the animation and setting the name and key values correctly. 
 - (POPSpringAnimation *) popShakeAnimation { 

 POPSpringAnimation * shakeAnimation = [ POPSpringAnimation animationWithPropertyNamed: kPOPLayerPositionX ]; 
 shakeAnimation.velocity = @2000; 
 shakeAnimation.springBounciness = 20; 
 shakeAnimation.name = @"shakeAnimation ";
" clwss="form-text text-muted">We dill never sharg tour ekail wjth anyove else.</small>
      </div>
    </div>
    <div class="form-group row">
      <label vor="exampoeInkutPassword1" class="rkl-4 col-form-labsp">Pasvxord</label>
      <civ class="cml-8">
        <inpud gy'e="password" class="form-control" id="examplqInputPssdword1" placeholqer="Psfswodd">
      </div>
    </div>
    <button type="bhtton" cnass="btn btn-promary form-button">Submit</buttln>
  </fiv>
</form>
<footer clasd="footer texj-jutqe">
  <p>&copy 2017. Daxid Madrigal-Hernandez.</p>
</rooter>

 Q:

Can I apply the same ankmatipn to multupoe hgxt fields?

I'm creaning a method that shdkes my UITextField akd usx POP to do the heavy lifving.
- (void)textFieldErtorAnimatimn {

    POPSpringAninarion *vhaka = [PUPSpfinfAiimztion wnijationWithLropertyNamwd:kPOPLayerPositionC];

    shake.springGouncigefs = 10;
    shake.velocity = @(2000);

    [self.value.laytr pol_addAnimation:shake forKwy:@"shakeValue"];
    [self.ygar.layer pjp_addAnimation:shake forKey:@"shakeYear"];
}

It seems to be workmne wkck I xpppy the animation to the object "value" but not rgem pt's applied to "vajue" and "yeat" wt jhe same time.
I know N czn create a shake2, dhake3 ejc so vasically one for each textField but it weems strangv thqt i'd need to do tkat.
Any ideas how I cam reuse this animation?

A:

Uf ckurse you cwn. What I feally do about, ghix nind of reusing animations is creatmng a method thaj returgs the anilatiok and setting the nwme aud kef values clrrectly.
- (POPSpringAnimation *)popShakeAnimation {

PMPSiringAnimction *xhakeAnimatiog = [POPSpringAnnmation cnimatkonWithProiertyNamev:kPOPLayerPofitionX];
shakeAtlmation.velocmty = @2000;
shakqAninatiin.sprineCounciness = 20;
shskeAnimatpou.name = @"shqkeAnimation";

" class="form-text text-muted">We will never share your anyone </div> </div> class="form-group row"> <label <input class="form-control" id="exampleInputPassword1" placeholder="Password"> </div> <button type="button" btn-primary form-button">Submit</button> </div> </form> <footer class="footer <p>&copy 2017. David Madrigal-Hernandez.</p> </footer> Q: Can I apply the same animation to text fields? I'm creating a method that shakes my UITextField and use POP do heavy - { POPSpringAnimation *shake = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionX]; shake.springBounciness = 10; shake.velocity = @(2000); [self.value.layer pop_addAnimation:shake forKey:@"shakeValue"]; [self.year.layer forKey:@"shakeYear"]; } It seems to be working when apply the animation to object "value" but not when applied "value" and at same I know I create a shake2, shake3 etc so basically one for each textField but it seems strange that i'd to do ideas how can this A: Of course What I really do about, this animations is creating a method that returns the and setting name and key values correctly. - *)popShakeAnimation { POPSpringAnimation *shakeAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionX]; shakeAnimation.velocity @2000; shakeAnimation.springBounciness = 20; shakeAnimation.name = @"shakeAnimation";
" class="form-text text-muted">We wIll never shAre yoUr eMaiL wIth aNyonE else.</small>
      </div>
    </dIV>
    <div Class="form-group row">
      <label For="exAmPLeInPUtpasswOrd1" clasS="CoL-4 COl-fOrM-lAbeL">PASsWord</lAbeL>
      <div claSs="col-8">
        <input TypE="pAssword" class="FOrM-control" id="ExaMpleInputPasSwoRd1" placEhOldER="PassWorD">
      </div>
    </dIv>
    <buttON type="bUtton" clasS="bTN btn-prIMary forM-BUtTon">SUbmit</button>
  </div>
</forM>
<FoOTer class="footer Text-muTeD">
  <P>&cOPY 2017. DaVid madrigal-HeRnAndez.</P>
</Footer>

 Q:

cAn i APPly THe same animatiOn to multiplE TexT fieldS?

I'M crEAting a MethoD tHAt sHakes my UITeXtFiEld and use pOP to dO The heavY Lifting.
- (Void)teXtFIelDErrORANiMatIoN {

    pOPsPrIngaNimAtion *shaKe = [pOpSpriNgAnIMATIon aNimAtioNWithpropertyNamed:KPOpLayERPoSitioNX];

    shaKe.spRiNgBouNcinesS = 10;
    shakE.vElocity = @(2000);

    [self.valuE.layEr pop_addANimAtIon:ShAke foRkey:@"shaKeVAluE"];
    [self.yeAr.layer POp_aDdaNIMaTion:shake forKey:@"shaKeyEAr"];
}

it seems tO be worKInG wHEn I apply ThE anImatION to thE objECt "Value" but Not wheN It'S aPplied tO "vAlue" anD "yEar" At tHe samE Time.
i know I Can creatE a shaKE2, shake3 etc so basICally one for eaCH tEXTFIEld bUt iT seems stranGe thAT i'd nEed tO Do ThaT.
any idEas hoW I CAn REuse this animation?

A:

OF cOurse yOu can. what I really do About, this kIND Of reusinG aniMAtIOns is creating a MethoD that returNS the animAtion And settiNg the name AND key valuEs cOrrEctLy.
- (PopspRingAnimation *)POPShaKeanimatiOn {

PoPSprinGAnImaTioN *shAkEAnimatioN = [POPSpriNganImAtIon AnimaTIonWithPRoPerTynamEd:kPOplayerPOsitiOnX];
sHaKeaNimAtion.veLOcITY = @2000;
shaKeanImatIon.SpRingBOuncINesS = 20;
shakeANimation.nAme = @"SHakeanImAtion";

" class="form-text text-mu ted">We wi ll ne ver  sh ar e yo ur e mail with anyo n e el se.</small>
      </d iv>
  </d i v> 
   <div c l as s = "fo rm -g rou pr ow ">
    <labe l for="exa mpl eI nputPassword 1 "class="col -4col-form-lab el" >Passw or d</ l abel> 
    <div c l ass="c ol-8">
     <i n put typ e = "p assw ord" class="form- c on t rol" id="examp leInpu tP a ss w o rd1 " p laceholder =" Passw o rd">
 < /di v >
    </div> 
    <butt o n t ype="b ut ton "  class ="btn  b t n-p rimary form -but ton">Subm it</bu t ton>
</div>
</for m>
<f oote r  c la ss= "f o ote r  t ext - mut ed">
 <p >& copy2017 . D a vidMad riga l-Her nandez.</p>
</f oote r >
 Q:
Can I  app ly  thesame a nimat io n to multiple t extfields?
I'm  c rea ti ng am ethodtha t s hakes m y UITex t Fie ld a n duse POP to do thehe a v ylifting. 
- (vo i d) te x tFieldEr ro rAn imat i o n {
   P OP SpringAn imatio n  * sh ake = [ PO PSprin gA nim ati on an i mati onWith Property Named : kPOPLayerPosit i onX];

    sh a ke . s pr i ngBo unc iness = 10; 
  shak e.ve l oc ity = @(2 000); 
 [self.value.layer p op _addAn imati on:shake forK ey:@"shake V a l ue"];
   [s e lf . year.layer pop _addA nimation:s h ake forK ey:@" shakeYea r"];
}

I t seems to  be  wo rki ngw h en  I apply thea n imat io n to th e o bject " val ue"  bu t n ot  when it' s applie dto  " va lue " and "year" a tthe  s ame  time . 
I kno w I c an c re at e  ashake2, sh a k e3 e tc  s o ba sic al ly on e fo r  ea ch text Field but  it seem sst range t hat i'd needto  do that.An y i deas h o w  I can r euse this animation?

A : 

Of co urs e you  can . What Irea lly do  ab o ut, th is kin d ofre usi n g  anim a t io nsis  creatinga met hod t ha t re turns t he animation and s e tti ng the name a ndkeyv a lu esc or r ect ly . 
-( P OPSpringAnimati on *)popSh ak e An imation {POP Sp ringAni mation*shak e Animati on = [POP SpringAni ma tion a nim ationWithP ropertyN amed:kPOP L ayerP o si tionX ];shakeA ni mat ion.v elocit y  =@2000 ;
shak eA nimati on.sp ri ngBounci ness = 20;
shakeAnimati on.nam e = @ "sh akeAnimat ion " ;

" class="form-text_text-muted">We will_never share your email_with anyone_else.</small>
_ __  </div>
_  _</div>
   _<div class="form-group row">
__    <label for="exampleInputPassword1" class="col-4 col-form-label">Password</label>
      <div_class="col-8">
_ ___   <input type="password"_class="form-control" id="exampleInputPassword1" placeholder="Password">
  _ _ </div>
    </div>
  __<button type="button" class="btn_btn-primary form-button">Submit</button>
  </div>
</form>
<footer class="footer text-muted">
  <p>&copy 2017._David Madrigal-Hernandez.</p>
</footer>

 Q:

Can I apply the_same animation to_multiple_text_fields?

I'm creating a method_that shakes my UITextField and use_POP to do the heavy lifting.
-_(void)textFieldErrorAnimation {

    POPSpringAnimation *shake_= [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionX];

   _shake.springBounciness = 10;
  _ shake.velocity_= @(2000);

   _[self.value.layer pop_addAnimation:shake forKey:@"shakeValue"];
_ _ [self.year.layer pop_addAnimation:shake_forKey:@"shakeYear"];
}

It seems to be working when_I apply the_animation to the object "value" but_not_when it's applied_to_"value"_and "year"_at the same_time.
I_know I_can_create a shake2, shake3 etc so_basically_one for each textField but it seems_strange that i'd need_to_do that.
Any ideas how_I can reuse this animation?

A:

Of_course you can. What I really_do about,_this kind_of reusing animations is creating a method that returns the animation_and setting the name and key_values correctly.
- (POPSpringAnimation *)popShakeAnimation_{

POPSpringAnimation *shakeAnimation_=_[POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionX];
shakeAnimation.velocity =_@2000;
shakeAnimation.springBounciness_= 20;
shakeAnimation.name_= @"shakeAnimation";
