AutoInch icon indicating copy to clipboard operation
AutoInch copied to clipboard

希望更具有语义化

Open manondidi opened this issue 6 years ago • 5 comments

.i35("3.5 inches (iPhone 4, 4s)") .i40("3.5 inches (iPhone 5, 5s, SE)") .i47("3.5 inches (iPhone 6, 7, 8)") .i55("3.5 inches (iPhone 6, 7, 8 Plus)") .ifull("full screen (iPhone X, Xs, XsMax)") .i58full("5.8 inches (iPhone X, Xs)") .i61full("6.1 inches (iPhone XR)") .i65full("6.5 inches (iPhone XsMax)")

希望可以 更具语义化 i40 这种可读性太差

manondidi avatar Dec 27 '18 08:12 manondidi

考虑到过长的命名可能带来代码风格过于啰嗦, 我也在寻找更简洁明确的命名方式, 您有什么好的建议吗?

lixiang1994 avatar Dec 28 '18 03:12 lixiang1994

通常以宽度为准啊 asIphone5Width asIphone6Width asIphone6PWidth asIphoneXWidth 这样会不会更语义化一些呢

manondidi avatar Dec 30 '18 10:12 manondidi

宽度的API我也有提供的 目前叫做 w320() w375() w414(), 过长的命名会让调用时代码显得非啰嗦, 就像OC的代码 又臭又长, 我现在已经由几个好的idea了 正在尝试, 确定下来后再更新哈.

lixiang1994 avatar Dec 31 '18 10:12 lixiang1994

w320() w375() w414() 也是不错的, asIphone5Width配合上代码换行 并不会又臭又长, 写代码可以不写注释,尽量要让代码的可读性增强.

manondidi avatar Dec 31 '18 15:12 manondidi

这块改善了吗

manondidi avatar Feb 01 '19 02:02 manondidi