It's a also a good practice to separate the contents/calculations of the variable in a separate function for readability like so:
// MARK: Public views
lazy var titleView = getTitleView()
lazy var hintView = getHintView(.red)
lazy var secondHintView = getHintView(.blue)
lazy var thirdHintView = getHintView(.yellow)
lazy var fourthHintView = getHintView(.brown)
// MARK: Private functions
private func getTitleView() -> TitleView {
let view = TitleView()
return view
}
private func getHintView(_ textColor: UIColor) -> HintView {
let view = HintView()
view.textColor = textColor
return view
}
That way you can reuse some of the functionality, have to write less code and all of your variables are a lot more readable. E.g. I have 5 separate variables, but I can see them all with one glance.