cgosingtian/Battle-of-Blades — pull request #8 by cgosingtian (2014-09-10 01:25:47+00:00)
Title: Changed button destruction-recreation logic to reuse ("deactivate-reactivate")

This reduces the growth of abandoned memory, majority of which is caused by the non-opaque CALayers of the UILabels on the Attack Buttons. By simply deactivating and then reactivating those buttons, we limit the heap allocation to the number of buttons we have (in this case, 16 buttons total in a 4 x 4 grid) instead of it being infinite.

The Enemy Shield type buttons still use the destruction-recreation style since they don't have any retain cycles and have no UILabels and such that might make them heavy to use. Their image is already cached in the Image Store.