Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import UIKit
- setViewControllerArray([page_one, page_two, page_three, page_four, page_five, page_six])
- setFirstViewController(0)
- setNavigationBarHidden(true, animated: false)
- //Uso de SwipeViewController Cocoapods
- //Creación de botones
- 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))
- btnNew.setTitle("SOY NUEVO", for: .normal)
- btnNew.addTarget(self, action: #selector(soyNuevo), for: .touchUpInside)
- btnNew.layer.cornerRadius = 25.0
- btnNew.layer.masksToBounds = true
- btnNew.backgroundColor = getColorByHex(rgbHexValue: 0x0071bc, alpha: 1.0)
- btnNew.titleLabel!.font = UIFont(name: "OpenSans-Semibold", size: 13)
- self.view.addSubview(btnNew)
- 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))
- btnCta.setTitle("YA TENGO CUENTA", for: .normal)
- btnCta.addTarget(self, action: #selector(tengoCuenta), for: .touchUpInside)
- btnCta.layer.cornerRadius = 25.0
- btnCta.layer.masksToBounds = true
- btnCta.backgroundColor = getColorByHex(rgbHexValue: 0xff5004, alpha: 1.0)
- btnCta.titleLabel?.font = UIFont(name: "OpenSans-Semibold", size: 13)
- self.view.addSubview(btnCta)
- //Creación de botones
- }
- func soyNuevo(sender: UIButton){
- print("Soy Nuevo")
- performSegue(withIdentifier: "segue_1", sender: self)
- }
- func tengoCuenta(sender: UIButton){
- print("Ya Tengo Cuenta")
- }
- func getColorByHex(rgbHexValue:UInt32, alpha:Double = 1.0) -> UIColor {
- let red = Double((rgbHexValue & 0xFF0000) >> 16) / 256.0
- let green = Double((rgbHexValue & 0xFF00) >> 8) / 256.0
- let blue = Double((rgbHexValue & 0xFF)) / 256.0
- return UIColor(red: CGFloat(red), green: CGFloat(green), blue: CGFloat(blue), alpha: CGFloat(alpha))
- }
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- // Dispose of any resources that can be recreated.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement