Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. // iPhone 8 - each view is 220
  2. if (UIScreen.main.bounds.height == 667.0) {
  3. for constraint in self.backgroundChartView.constraints {
  4. if constraint.identifier == "chartHeightConstraint" {
  5. constraint.constant = 220
  6. }
  7. }
  8.  
  9. for constraint in self.tableViewBackground.constraints {
  10. if constraint.identifier == "tableHeightConstraint" {
  11.  
  12. constraint.constant = 220
  13. }
  14. }
  15. }
  16.  
  17. // iPhone 8 Plus/ iPhone XS - each view is 260
  18. if (UIScreen.main.bounds.height == 736.0 || UIScreen.main.bounds.height == 812.0) {
  19. for constraint in self.backgroundChartView.constraints {
  20. if constraint.identifier == "chartHeightConstraint" {
  21. constraint.constant = 260
  22. }
  23. }
  24.  
  25. for constraint in self.tableViewBackground.constraints {
  26. if constraint.identifier == "tableHeightConstraint" {
  27.  
  28. constraint.constant = 260
  29. }
  30. }
  31. }
  32.  
  33. // update sublayouts
  34. self.backgroundChartView.layoutIfNeeded()
  35. self.tableViewBackground.layoutIfNeeded()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement