Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // NewBidCardViewController.swift
- // UOnLoad
- //
- // Created by Ivan Lupenkov on 10/12/19.
- // Copyright © 2019 UOnLoad. All rights reserved.
- //
- import UIKit
- class NewBidCardViewController: UIViewController {
- let loadsDetailsViewController = LoadsDetailsViewController()
- var loadId: Int = 0
- var amount: String = ""
- @IBOutlet weak var handleArea: UIView!
- @IBOutlet weak var handleLabel: UILabel!
- @IBOutlet weak var handleArrowImage: UIImageView!
- @IBOutlet weak var amountLabel: UILabel!
- @IBAction func confirmBidButton(_ sender: UIButton) {
- let floatAmount = (amount as NSString).floatValue
- sendBid(amount: floatAmount, load_id: self.loadId)
- }
- @IBAction func NumPad_1(_ sender: Any) {
- amount += "1"
- amountLabel.text = "$\(amount)"
- }
- @IBAction func NumPad_2(_ sender: Any) {
- amount += "2"
- amountLabel.text = "$\(amount)"
- }
- @IBAction func NumPad_3(_ sender: Any) {
- amount += "3"
- amountLabel.text = "$\(amount)"
- }
- @IBAction func NumPad_4(_ sender: Any) {
- amount += "4"
- amountLabel.text = "$\(amount)"
- }
- @IBAction func NumPad_5(_ sender: Any) {
- amount += "5"
- amountLabel.text = "$\(amount)"
- }
- @IBAction func NumPad_6(_ sender: Any) {
- amount += "6"
- amountLabel.text = "$\(amount)"
- }
- @IBAction func NumPad_7(_ sender: Any) {
- amount += "7"
- amountLabel.text = "$\(amount)"
- }
- @IBAction func NumPad_8(_ sender: Any) {
- amount += "8"
- amountLabel.text = "$\(amount)"
- }
- @IBAction func NumPad_9(_ sender: Any) {
- amount += "9"
- amountLabel.text = "$\(amount)"
- }
- @IBAction func NumPad_confirm(_ sender: Any) {
- let floatAmount = (amount as NSString).floatValue
- sendBid(amount: floatAmount, load_id: self.loadId)
- }
- @IBAction func NumPad_0(_ sender: Any) {
- amount += "0"
- amountLabel.text = "$\(amount)"
- }
- @IBAction func NumPad_del(_ sender: Any) {
- amount = String(amount.dropLast())
- amountLabel.text = "$\(amount)"
- }
- func sendBid(amount: Float?, load_id: Int?){
- loadsDetailsViewController.saveBid(bid: amount, loadId: load_id)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment