Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let viewController: ViewController = ViewController()
- navigationController = UINavigationController(rootViewController: viewController)
- navigationController?.hidesBarsOnSwipe = true
- self.window = UIWindow(frame: UIScreen.main.bounds)
- self.window?.rootViewController = navigationController
- func makeRect(){
- let shape = UIView(frame: CGRect(
- x: self.view.center.x + 10,
- y: self.view.frame.size.height - 80,
- width: self.view.frame.size.width/2 - 30,
- height: 50))
- shape.layer.shadowOffset = CGSize(width: 5, height: 5)
- shape.layer.shadowOpacity = 0.3
- shape.layer.shadowRadius = 2
- shape.layer.cornerRadius = 5
- shape.layer.borderWidth = 1
- shape.layer.borderColor = UIColor.darkGray.cgColor
- view.addSubview(shape)
- let gesture = UITapGestureRecognizer(target: self, action: #selector(ViewController.action2))
- shape.addGestureRecognizer(gesture)
- }
Add Comment
Please, Sign In to add comment