Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // iPhone 8 - each view is 220
- if (UIScreen.main.bounds.height == 667.0) {
- for constraint in self.backgroundChartView.constraints {
- if constraint.identifier == "chartHeightConstraint" {
- constraint.constant = 220
- }
- }
- for constraint in self.tableViewBackground.constraints {
- if constraint.identifier == "tableHeightConstraint" {
- constraint.constant = 220
- }
- }
- }
- // iPhone 8 Plus/ iPhone XS - each view is 260
- if (UIScreen.main.bounds.height == 736.0 || UIScreen.main.bounds.height == 812.0) {
- for constraint in self.backgroundChartView.constraints {
- if constraint.identifier == "chartHeightConstraint" {
- constraint.constant = 260
- }
- }
- for constraint in self.tableViewBackground.constraints {
- if constraint.identifier == "tableHeightConstraint" {
- constraint.constant = 260
- }
- }
- }
- // update sublayouts
- self.backgroundChartView.layoutIfNeeded()
- self.tableViewBackground.layoutIfNeeded()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement