对于快速性能的扩展是否有害? [英] are extensions bad for performance in swift?

查看:101
本文介绍了对于快速性能的扩展是否有害?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Swift提供编写扩展的功能。我做了很多,以使我的代码更容易阅读。不确定它们是否无害。我想知道,由于性能原因,省略扩展会更好吗?

Swift offers the ability to write extensions. I do that a lot to make my code easier to read. Not sure if they are harmless. I am wondering, would it be better to just omit extensions, because of performance reasons?

推荐答案

Apple鼓励使用扩展程序。您可以在Swift文档中阅读有关它们的更多信息此处

Apple encourages the use of extensions. You can read more about them on the Swift documentation here.

这篇关于对于快速性能的扩展是否有害?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆