Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. import UIKit
  2.  
  3. setViewControllerArray([page_one, page_two, page_three, page_four, page_five, page_six])
  4. setFirstViewController(0)
  5. setNavigationBarHidden(true, animated: false)
  6.  
  7. //Uso de SwipeViewController Cocoapods
  8. //Creación de botones
  9. let btnNew = UIButton(frame: CGRect(x: self.view.frame.size.width / 2 + 30, y: self.view.frame.size.height - 75, width: self.view.frame.size.width / 2 - 35, height: 50))
  10. btnNew.setTitle("SOY NUEVO", for: .normal)
  11. btnNew.addTarget(self, action: #selector(soyNuevo), for: .touchUpInside)
  12. btnNew.layer.cornerRadius = 25.0
  13. btnNew.layer.masksToBounds = true
  14. btnNew.backgroundColor = getColorByHex(rgbHexValue: 0x0071bc, alpha: 1.0)
  15. btnNew.titleLabel!.font = UIFont(name: "OpenSans-Semibold", size: 13)
  16. self.view.addSubview(btnNew)
  17.  
  18. let btnCta = UIButton(frame: CGRect(x: self.view.frame.size.width - self.view.frame.size.width + 10, y: self.view.frame.size.height - 75, width: self.view.frame.size.width/2-35, height: 50))
  19. btnCta.setTitle("YA TENGO CUENTA", for: .normal)
  20. btnCta.addTarget(self, action: #selector(tengoCuenta), for: .touchUpInside)
  21. btnCta.layer.cornerRadius = 25.0
  22. btnCta.layer.masksToBounds = true
  23. btnCta.backgroundColor = getColorByHex(rgbHexValue: 0xff5004, alpha: 1.0)
  24. btnCta.titleLabel?.font = UIFont(name: "OpenSans-Semibold", size: 13)
  25. self.view.addSubview(btnCta)
  26. //Creación de botones
  27. }
  28.  
  29. func soyNuevo(sender: UIButton){
  30. print("Soy Nuevo")
  31. performSegue(withIdentifier: "segue_1", sender: self)
  32. }
  33. func tengoCuenta(sender: UIButton){
  34. print("Ya Tengo Cuenta")
  35. }
  36.  
  37. func getColorByHex(rgbHexValue:UInt32, alpha:Double = 1.0) -> UIColor {
  38. let red = Double((rgbHexValue & 0xFF0000) >> 16) / 256.0
  39. let green = Double((rgbHexValue & 0xFF00) >> 8) / 256.0
  40. let blue = Double((rgbHexValue & 0xFF)) / 256.0
  41.  
  42. return UIColor(red: CGFloat(red), green: CGFloat(green), blue: CGFloat(blue), alpha: CGFloat(alpha))
  43. }
  44.  
  45. override func didReceiveMemoryWarning() {
  46. super.didReceiveMemoryWarning()
  47. // Dispose of any resources that can be recreated.
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement