Difference between block (Objective C) and closure (Swift) in ios -
in tutorials written functionally both same closure more easier block , avoided complexity of block , memory management, i've gone through many tutorials except these i'm not getting difference between swift's "closure" , objective-c "block".
can explain difference in deep. help appreciated.
excerpt from: apple inc. “using swift cocoa , objective-c.” ibooks:
“swift closures , objective-c blocks compatible, can pass swift closures objective-c methods expect blocks. swift closures , functions have same type, can pass name of swift function.
closures have similar capture semantics blocks differ in 1 key way: variables mutable rather copied. in other words, behavior of __block in objective-c default behavior variables in swift.”
ios objective-c swift closures objective-c-blocks
No comments:
Post a Comment