Swift类在一个文件 [英] Swift Classes in One File

查看:102
本文介绍了Swift类在一个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道在python这是一个好的习惯,有一个 models.py 并把所有的应用程序的模型类。这同样适用于swift或更好的是为每个模型类有一个单独的文件?

I know in python it is good practice to have a models.py and put all of an application's model classes in there. Does the same apply to swift or is it better to have a separate file for each model class?

感谢!

推荐答案

Apple建议为每个文件模型类,但是可以使用Python风格

Apple recommends to have separate files for each model class however it's possible to use the "Python style"

这篇关于Swift类在一个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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