我可以用更简短的形式编写以下代码行吗?
长
self.settings.style.buttonBarBackgroundColor = .white
self.settings.style.buttonBarItemBackgroundColor = .white
self.settings.style.selectedBarBackgroundColor = selectedColor
短
var st = self.settings.style
st.buttonBarBackgroundColor = .white
st.buttonBarItemBackgroundColor = .white
st.selectedBarBackgroundColor = selectedColor
理想情况是这样的:
self.settings.style {
.buttonBarBackgroundColor = .white
.buttonBarItemBackgroundColor = .white
.selectedBarBackgroundColor = selectedColor
}