我曾在Objective-C中编写过这样的函数,
-(void)addView:(UIView *)view belowView:(UIView *)viewAbove aboveView:(UIView *)viewBelow withHeight:(CGFloat)height{
// Code goes here
}
当在参数之间放置换行符时,它们会像这样整齐地自动对齐,
-(void)addView:(UIView *)view
belowView:(UIView *)viewAbove
aboveView:(UIView *)viewBelow
withHeight:(CGFloat)height{
// Code goes here
}
同样没有发生swift,这些长函数看起来不太可读
private func addView(view: UIView,
belowView viewAbove: UIView,
aboveView viewBelow: UIView,
withHeight height: CGFloat) {
}
如何在Objective-C
中像我以前那样对齐长函数我试过的Xcode版本是7.3.1