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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -