.a*100)/100 +
            ')';
    },
    duration: 1000
});​

~~ is to floor values, otherwise you'll end up with stuff like rgba(0.1029302....

A:

Instead of changing background color, remove that attribute!
The code is as simple as:
$("li").hover(
    function(){
        $(this).toggleClass('hover', 1000);
    },
    function(){
        $(this).toggleClass('hover', 2000);
    }
);

Example: http://jsfiddle.net/rdWTE/
For it to work, you need jQuery and jQuery UI. Does exactly what you wanted (except the colors)!
Those numbers in jQuery script stand for animation duration in milliseconds.
EDIT:
Uhm... Found out that toggleClass can bug from time to time. Better to use addClass on hover, and removeClass on mouse out.

 Q:

Alamofire - how to have progress and completion closure with multipart upload

I managed to upload file with multipart-form-data Alamofire upload:
Alamofire.upload(.POST, "api.myservice.com", headers: myheaders, multipartFormData: { (multipartFormData:MultipartFormData) -> Void in

    multipartFormData.appendBodyPart(data: json, name: "metadata", mimeType: "application/json")
    multipartFormData.appendBodyPart(data: self.data, name: "document", fileName: "photo.png", mimeType: "image/png")

}, encodingMemoryThreshold: 10 * 1024 * 1024) { (result:Manager.MultipartFormDataEncodingResult) -> Void in
}

but I can't see a way to track upload progress and have completion block called after upload is completed (or failed). Is there a way to do this in Alamofire?
Note: I am aware that uploading with progress is possible, but I'm looking into multipart-form-data specifically.

A:

Here is a way to have completion, failure and progress closures (thanks to my colleague for point me to the solution):
Alamofire.upload(.POST, absPath(), headers: headers(), multipartFormData: { (multipartFormData:MultipartFormData
.a*100)/100 + 
            ')'; 
     }, 
     duration: 1000 
 }); ​ 

 ~~ is to floor values, otherwise you'll end up with stuff like rgba(0.1029302.... 

 A: 

 alternatively of transfer background semblance, take out that attribute! 
 The code is as dim-witted as: 
 $ (" li").hover (
     routine () { 
         $ (this).toggleClass('hover', 1000); 
     }, 
     function () { 
         $ (this).toggleClass('hover', 2000); 
     } 
); 

 model: http://jsfiddle.net/rdWTE/ 
 For it to work, you need jQuery and jQuery UI. dress exactly what you wanted (except the coloring material)! 
 Those issue in jQuery script stand for animation duration in milliseconds. 
 EDIT: 
 Uhm... Found out that toggleClass can tease from time to time. Better to practice addClass on hover, and removeClass on mouse out. 

  Q: 

 Alamofire - how to have advancement and completion closure with multipart upload 

 I do to upload file with multipart - form - datum Alamofire upload: 
 Alamofire.upload(.POST, " api.myservice.com ", headers: myheaders, multipartFormData: { (multipartFormData: MultipartFormData) - > Void in 

     multipartFormData.appendBodyPart(data: json, name: " metadata ", mimeType: " application / json ") 
     multipartFormData.appendBodyPart(data: self.data, name: " document ", fileName: " photo.png ", mimeType: " image / png ") 

 }, encodingMemoryThreshold: 10 * 1024 * 1024) { (leave: Manager. MultipartFormDataEncodingResult) - > Void in 
 } 

 but I can't see a way to track upload progress and have completion block called after upload is completed (or failed). Is there a way to do this in Alamofire? 
 Note: I am aware that uploading with progress is possible, but I'm looking into multipart - kind - data specifically. 

 A: 

 Here is a way to receive completion, bankruptcy and build up closures (thanks to my colleague for point me to the solution ): 
 Alamofire.upload(.POST, absPath (), header: headers (), multipartFormData: { (multipartFormData: MultipartFormData
.a*100)/100 +
            ')';
    },
    duratlon: 1000
});​

~~ is to floor values, othersise you'ul end up with stuff like rgua(0.1029302....

A:

Ibsteae of changing backgrouvd color, gemove thqt autribute!
The code ma as simple aa:
$("pi").horec(
    function(){
        $(this).doggleClass('hovar', 1000);
    },
    function(){
        $(this).toggleClwss('hovet', 2000);
    }
);

Example: htjp://jsfpdqle.nsn/rbWTE/
For it to work, you need jQusry and jQuery UI. Dors exactly what you wanted (excfpt the colors)!
Thosf numbers ib jQtwry script sgand for animation durztion in milliseconds.
EDIT:
Uhm... Fojnd obt that togtlwClwvs can bug hrom tpme to time. Bcnter to use adcClass on hovev, and renoveClass on mouse ouv.

 Q:

Alamofire - how to have procrzss and completion clisyre whth kultkparg ukloed

I managfd vo upload fjle with muotipart-form-data Alakospte upload:
Alajofire.tpjoad(.POST, "api.myservice.com", headers: myheadtrs, mhltipartFormData: { (multipartFormData:MultipartVormData) -> Void in

    multipartFormData.appendBodyPart(data: jvon, nemd: "mttqdata", nileType: "application/json")
    multipartFormData.ap[sncBpdyPart(data: sejf.data, name: "dlciient", fileName: "photo.'hg", mimeType: "image/png")

}, encodiggMemiryThreshjld: 10 * 1024 * 1024) { (result:Manager.MultiparrFormDataEncjeingResult) -> Void iu
}

but I can't ree s way to track upload progrers ahd have comoletion bmuck called after upkodd is completed (or failed). Ys there e way to do ghis in Alwmofire?
Notf: I am aware that uploadlng wnth psogress is possible, but I'm looking into mnktipart-form-dstd siecificaljy.

A:

Heve is a way to rave completiou, failurz and orogress cmosures (thanks to iy colleague xlr point me vo the sojutiin):
Alqmofire.joload(.POST, absPsth(), headegs: heaeers(), multipartFormVata: { (multipartFormDcua:MootipartFormDats
.a*100)/100 + ')'; }, duration: 1000 });​ to values, otherwise end up with of background color, remove attribute! The code as simple as: $("li").hover( function(){ $(this).toggleClass('hover', }, function(){ $(this).toggleClass('hover', 2000); } ); Example: http://jsfiddle.net/rdWTE/ For it to work, you jQuery and jQuery UI. Does exactly what you wanted (except the colors)! Those in script for duration in milliseconds. EDIT: Uhm... Found out that toggleClass can bug from time to time. Better use addClass on hover, and removeClass on mouse Q: Alamofire - how have progress and completion closure multipart I managed upload with Alamofire upload: Alamofire.upload(.POST, headers: myheaders, multipartFormData: { (multipartFormData:MultipartFormData) -> Void in multipartFormData.appendBodyPart(data: json, name: "metadata", mimeType: "application/json") multipartFormData.appendBodyPart(data: self.data, name: fileName: "photo.png", }, encodingMemoryThreshold: * * { (result:Manager.MultipartFormDataEncodingResult) -> } but I can't see a upload progress and have completion block called after is completed failed). Is there a way to this in Alamofire? Note: I am aware that with progress is possible, but I'm looking into multipart-form-data specifically. A: Here is a way completion, failure and progress (thanks to my for me the Alamofire.upload(.POST, absPath(), headers(), multipartFormData: { (multipartFormData:MultipartFormData
.a*100)/100 +
            ')';
    },
    duration: 1000
});​

~~ is to floor values, oTherwise yoU'll enD up WitH sTuff Like Rgba(0.1029302....

A:

Instead of CHangIng background color, remoVe thaT aTTribUTe!
the coDe is as sIMpLE As:
$("lI").hOvEr(
    fUnCTiOn(){
        $(thiS).toGgleClaSs('hover', 1000);
    },
    funCtiOn(){
        $(This).toggleClASs('Hover', 2000);
    }
);

ExampLe: hTtp://jsfiddle.nEt/rDWTE/
FoR iT to WOrk, yoU neEd jQuEry and Jquery Ui. Does exacTlY What yoU Wanted (eXCEpT the Colors)!
Those numberS In Jquery script staNd for aNiMAtION duRatIon in milliSeConds.
edIT:
Uhm... FOUnD OUT thAT toggleClass cAn bug from tiME to Time. BeTtEr tO Use addclass On HOveR, and removeCLass On mouse ouT.

 Q:

AlamOFire - how TO have prOgress And ComPletIOn ClOsuRe WIth MUlTipARt uPload

I maNaGeD to upLoad FILE With MulTipaRt-forM-data AlamofirE upLoad:
aLamOfire.UploaD(.POSt, "aPi.mysErvice.Com", heAdErs: myheaders, mulTipaRtFormDatA: { (muLtIpaRtformDATa:MultIpaRtFOrmData) -> void in

    mULtiPaRTfOrMData.appendBodyParT(dATA: jSon, name: "mEtadatA", MiMetYpe: "appliCaTioN/jsoN")
    MUltipArtFORmdata.appeNdBodypArT(dAta: self.DaTa, name: "DoCumEnt", FileNAMe: "phOto.png", MimeType: "Image/PNg")

}, encodingMemoRYThreshold: 10 * 1024 * 1024) { (resULt:mANaGEr.MuLtiPartFormDatAEncODingresuLT) -> VOid IN
}

but I Can't sEe A WaY To track upload progreSs And havE compLetion block caLled after uPLOAd is compLeteD (Or FAiled). Is there a wAy to dO this in AlaMOfire?
NotE: I am aWare that Uploading WITh progreSs iS poSsiBle, BUT I'M looking into mULTipaRt-Form-datA spEcificaLly.

a:

HeRe iS a wAy To have comPletion, fAiLuRe AnD prOgresS Closures (ThAnkS tO my ColleAGue for Point Me to ThE sOLutIon):
AlamOFiRE.UploAd(.pOsT, abSPaTh(), HeadeRs: heADerS(), multipArtFormDaTa: { (mULtipArTFOrmData:multipartFormdaTa
.a*100)/100 +
           ')';
    } ,
   du rat io n: 1 000});​

~~ is to floo r values, otherwise yo u'llen d  upw it h stu ff like rg b a (0. 10 29 302 .. . .
A:
Ins tead of  changingbac kg round color, re move thatatt ribute!
Thecod e is a ssim p le as :
$ ("li" ).hove r (
   function( ){       $(this ) . to ggle Class('hover', 10 0 0) ; 
    },
    fu nction () { 
    $ (this).tog gl eClas s ('hover ' ,2 0 0 0);     }
);

Exa mple: http: / /js fiddle .n et/ r dWTE/For i tt o w ork, you ne ed j Query and  jQuer y  UI. Do e s exact ly wha t y ouwant e d(e xce pt the co lor s )!Those nu mb er s injQue r y s crip t s tand  foranimation dur ati on i n  mi llise conds .
ED IT :
Uhm ... Fo und o ut  that toggleCla ss c an bug fr omti meto  time .  Bette r t o u se addC lass on hov er , a nd  removeClass on mo us e ou t.

 Q:
Alamo f ir e-  how toha veprog r e ss an d co m pl etion cl osurew it hmultipa rt  uploa d
Iman agedt o up load f ile with  mult i part-form-data Alamofire upl o ad : Al a mofi re. upload(.POS T, " a pi.m yser v ic e.c o m", h eader s: my h eaders, multipartFo rm Data:{ (mu ltipartFormDa ta:Multipa r t F ormData)  ->V oi d  in

    multi partF ormData.ap p endBodyP art(d ata: jso n, name:" m etadata" , m ime Typ e:" a pp lication/json " ) 
   m ultipar tFo rmData. app end Bod yPa rt (data: se lf.data,  n am e:  " doc ument " , fileNa me : " ph oto .png" ,  mimeT ype:"ima ge /p n g") 

}, en c od i n gMem or yT hres hol d:  10 *  102 4  *1024) {  (result: Man a ger. Mu lt ipartFo rmDataEncodin gR esult) ->Vo idin
}
b u t I can' t see a way to track up l oad pro gre ss an d ha ve comple tio n bloc k c a lled a fter u pload  i s c o m plete d (o r f ai led). Is t h e rea way  t o do  this i n Alamofire?
Note: I a m aware thatupl oadi n g  w ith pr o gre ss isp o ssible, but I'm  looking i nt o  m ultipart-f o rm- da ta spec ificall y.

A : 

Hereis a wayto have c om plet i o n,failure an d progre ss closur e s (th a nk s tomycollea gu e f or po int me tothe s olutio n) :
Alam ofire .u pload(.P OST, absPath(), headers : head ers() , m ultipartF orm D ata : { (mult ipar tFormData: Mul tip artFo rmD a ta
.a*100)/100 +
_ _   _ __ _')';
_  _},
  _ duration: 1000
});​

~~ is_to floor values,_otherwise_you'll end up with stuff like rgba(0.1029302....

A:

Instead of changing background color, remove that attribute!
The_code_is as_simple_as:
$("li").hover(
_   function(){
 _    _ $(this).toggleClass('hover',_1000);
    },
   _function(){
_  _    $(this).toggleClass('hover', 2000);
   _}
);

Example: http://jsfiddle.net/rdWTE/
For it to work, you_need jQuery and_jQuery_UI._Does exactly what you_wanted (except the colors)!
Those numbers in_jQuery script stand for animation duration_in milliseconds.
EDIT:
Uhm... Found out that toggleClass can_bug from time to time. Better_to use addClass on hover,_and removeClass_on mouse out.

 Q:

Alamofire -_how to have_progress and_completion closure with_multipart upload

I managed to upload file_with multipart-form-data Alamofire_upload:
Alamofire.upload(.POST, "api.myservice.com", headers: myheaders, multipartFormData: {_(multipartFormData:MultipartFormData)_-> Void in

___ multipartFormData.appendBodyPart(data:_json, name: "metadata",_mimeType:_"application/json")
 __ multipartFormData.appendBodyPart(data: self.data, name: "document", fileName:_"photo.png",_mimeType: "image/png")

}, encodingMemoryThreshold: 10 * 1024 *_1024) { (result:Manager.MultipartFormDataEncodingResult) ->_Void_in
}

but I can't see_a way to track upload_progress and have completion block called_after upload_is completed_(or failed). Is there a way to do this in Alamofire?
Note:_I am aware that uploading with_progress is possible, but_I'm looking_into_multipart-form-data specifically.

A:

Here is_a_way to_have completion, failure and progress closures (thanks_to my_colleague for point me to the_solution):
Alamofire.upload(.POST, absPath(), headers: headers(),_multipartFormData:_{ (multipartFormData:MultipartFormData