dzenbot / DZNEmptyDataSet

A drop-in UITableView/UICollectionView superclass category for showing empty datasets whenever the view has no content to display

Home Page:https://www.cocoacontrols.com/controls/dznemptydataset

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Variable names can be misleading

zhfei opened this issue · comments

commented

In the method:swizzleIfPossible, there is a variable name definition error that will be misleading.

IMP dzn_newImplementation = method_setImplementation(method, (IMP)dzn_original_implementation)

According to the method method_setImplementation definition:

/**
  * Sets the implementation of a method.
  *
  * @param m The method for which to set an implementation.
  * @param imp The implemention to set to this method.
  *
  * @return The previous implementation of the method.
  */
OBJC_EXPORT IMP _Nonnull
method_setImplementation(Method _Nonnull m, IMP _Nonnull imp)

The following definition is more appropriate:

IMP dzn_oldImplementation = method_setImplementation(method, (IMP)dzn_original_implementation);