哪个更快? IBAction还是以编程方式?

时间:2016-10-15 09:03:24

标签: ios interface-builder swift3

我总是对此有疑问。 将20个UIButton挂钩到一个动作或者只是循环然后以编程方式添加它会更快吗?

E:\projektai\php projektai\htdocs\timetracker>composer require codeception/codec
eption --dev
Warning: This development build of composer is over 60 days old. It is recommend
ed to update it by running "C:\ProgramData\Composer\bin\composer.phar self-updat
e" to get the latest version.
Using version ^2.2 for codeception/codeception
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

 // Clearing the cache for the dev environment with debug
 // true

 [OK] Cache for the "dev" environment (debug=true) was successfully cleared.

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets

 Trying to install assets as relative symbolic links.

 --------- ----------------- ------------------
            Bundle            Method / Error
 --------- ----------------- ------------------
  WARNING   FrameworkBundle   absolute symlink
 --------- ----------------- ------------------

 [OK] All assets were successfully installed.

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFi
le
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarg
et

1 个答案:

答案 0 :(得分:0)

通过代码添加的20个按钮加载速度比通过资源文件加载更快。选择舒适度取决于开发人员。

是的特定应用程序,例如计算器或日历是正确且罕见的例子,但我评论说,一般来说,屏幕上有20个按钮很奇怪。