Objective-c to Swift conversion -


- (nsdata *)formencodedparameters:(nsdictionary *)parameters {     nsarray *pairs = [parameters.allkeys mappedarraywithblock:^id(id obj) {     return [nsstring stringwithformat:@"%@=%@",             [obj stringbyaddingpercentescapesusingencoding:nsutf8stringencoding],             [parameters[obj] stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]];     }];      nsstring *formbody = [pairs componentsjoinedbystring:@"&"];   return [formbody datausingencoding:nsutf8stringencoding]; } 

what best way convert method swift?

below link objective-c swift code "converter". matches syntax , replaces thinks appropriate.... still.... have kind of thing yourself. learn how code in swift , convert yourself.

in mean time (for educational reasons) can try converter: http://objectivec2swift.net/#/about


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -