Guest User

Untitled

a guest
Oct 22nd, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. let viewController: ViewController = ViewController()
  2.  
  3. navigationController = UINavigationController(rootViewController: viewController)
  4. navigationController?.hidesBarsOnSwipe = true
  5. self.window = UIWindow(frame: UIScreen.main.bounds)
  6. self.window?.rootViewController = navigationController
  7.  
  8. func makeRect(){
  9. let shape = UIView(frame: CGRect(
  10. x: self.view.center.x + 10,
  11. y: self.view.frame.size.height - 80,
  12. width: self.view.frame.size.width/2 - 30,
  13. height: 50))
  14.  
  15. shape.layer.shadowOffset = CGSize(width: 5, height: 5)
  16. shape.layer.shadowOpacity = 0.3
  17. shape.layer.shadowRadius = 2
  18. shape.layer.cornerRadius = 5
  19. shape.layer.borderWidth = 1
  20. shape.layer.borderColor = UIColor.darkGray.cgColor
  21. view.addSubview(shape)
  22.  
  23. let gesture = UITapGestureRecognizer(target: self, action: #selector(ViewController.action2))
  24. shape.addGestureRecognizer(gesture)
  25.  
  26.  
  27. }
Add Comment
Please, Sign In to add comment