Using only closures over functions in Swift -


after reading functions special case of closures, being named constant closure, there reason use function on closure? ran problem needed pass functions method sequential animation , ended needing transform functions closures. disadvantage , loss of flexibility, why ever want use functions on closures?

i advise use closures whenever need use code once , in point implement in whole code.

if need reuse logic of block of code, best way encapsulate code inside function , use callback.

i can´t imagine situation when need convert functions closures. need create function fits closure signature.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -