I have recently migrated to VIPER and while using this type of architecture came up with such question:
For instance, I have in designs long(2000pt height) UI with over 50 interface elements like labels, buttons, views, collections and so on and I need to add round corners and shadows to them.
Where should I configure its appearance? Should it be in View, or somehow in Presenter?
So far I have extended UIView to create a method to drop shadow.
Right now, what I have in View module is:
override func viewDidLayoutSubviews() {
doctorsNearCollection.backgroundColor = UIColor(white: 1, alpha: 0)
newsMayBeInterestedCollection.backgroundColor = UIColor(white: 1, alpha: 0)
recentSavedNewsCollection.backgroundColor = UIColor(white: 1, alpha: 0)
setupCharts()
scheduleMetting.dropShadow()
scheduleMetting.layer.cornerRadius = 5
monthlyPerformaceBackground.dropShadow()
monthlyPerformaceBackground.layer.cornerRadius = 5
firstMeeting.dropShadow()
firstMeeting.layer.cornerRadius = 5
firstMeetingNumber.layer.cornerRadius = self.firstMeetingNumber.frame.size.width / 2
secondMeeting.dropShadow()
secondMeeting.layer.cornerRadius = 5
secondMeetingNumber.layer.cornerRadius = self.secondMeetingNumber.frame.size.width / 2
thirdMeeting.dropShadow()
thirdMeeting.layer.cornerRadius = 5
thirdMeetingNumber.layer.cornerRadius = self.thirdMeetingNumber.frame.size.width / 2
seeAllMeetings.dropShadow()
seeAllMeetings.layer.cornerRadius = 5
searchForDoctors.dropShadow()
searchForDoctors.layer.cornerRadius = 5
seeAllSavedNews.dropShadow()
seeAllSavedNews.layer.cornerRadius = 5
}
Is this a good practice? I'm interested in setting up commonality among the appearance of views as factored out from other methods. It seems more or less clear to me. Thanks in advance.