Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. override func viewDidLayoutSubviews() {
  2.  
  3. // Add the logo hd background image and apply blur effect
  4. // in viewDidLayoutSubviews, the blur effect is correctly done after changing the orientation of the iPhone
  5.  
  6. let backgroundImage = UIImage(named: "logo-hd")
  7. let imageView = UIImageView(image: backgroundImage)
  8. self.tableView.backgroundView = imageView
  9. tableView.backgroundView?.contentMode = .scaleAspectFit
  10.  
  11. let blurEffect = UIBlurEffect(style: UIBlurEffect.Style.light)
  12. let blurView = UIVisualEffectView(effect: blurEffect)
  13. blurView.frame = imageView.bounds
  14. imageView.addSubview(blurView)
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement