SWIFT Unable to get total amount for live view on Click button

SWIFT Unable to get the total amount for live preview when clicking the button.

when i Enter data into one custom-dynamic view (TextField) and in another Cust-Dynamic (TextField) mode the data entered.

I want the sum of these two Txt fields in a TextField Outside.

Can anyone help me with this code, enter image description here

if you could see below. In general Sqft there is a total text field of sums, and the number of Cust-Dynamic View is called the sum of all the results of text fields that need to be updated in a common quadratic TextField. eg: 99 + 99 = 198.00 Thanks in Advance.

    func viewcall()
    {
      //  for _ in 0..<count {
        myView = customSubView(frame: CGRect(x: 100, y: 220+y_value, width: 400, height: 245))
        myView.backgroundColor = UIColor(white: 1, alpha: 0.5)
        myView.layer.cornerRadius = 15
        myView.Board_height.addTarget(self, action: #selector(didChangeText(textField:)), for: .editingChanged)
        myView.actionButton.addTarget(self, action: (#selector(cancelbutton(_:))), for: UIControlEvents.touchUpInside)
        myView.NoofBoardtext.addTarget(self, action:#selector(didChangeTexts(textField:)), for: .editingChanged)
        myView.numberofdays.addTarget(self, action:#selector(dayscalculation(textField:)), for: .editingChanged)
        self.scrlview.addSubview(myView)

}
func didChangeText(textField: UITextField)
    {
        myView.Board_total.text = String(Int(myView.Board_size.text!)! * Int(myView.Board_height.text!)!)

    }
//only Calculation for total SQFT
    func didChangeTexts(textField: UITextField)
    {
        myView.totalSQFT.text = String(Int(myView.NoofBoardtext.text!)! * Int(myView.Board_total.text!)!)
    }
//only Calculation for total SQFT
    func dayscalculation(textField: UITextField)
    {
       myView.totalDays.text = myView.numberofdays.text!
       myView.Totalsqfttext.text = String(Int(myView.totalSQFT.text!)! * Int(myView.numberofdays.text!)!)
        overallSQFTtext.text = myView.Totalsqfttext.text
    }

      

+3
ios dynamic swift


source to share


No one has answered this question yet

Check out similar questions:

388
Get the nth character of a string in Swift programming language
360
How do I get a reference to an app delegate in Swift?
317
How to get app version and build number using Swift?
291
Text Viewer (UITextView) Swift Placeholder
278
Get class name of object as string in Swift
245
Moving a view with keyboard with Swift
173
How do I get a list as a dictionary in Swift?
4
Adding a custom UIViewcontroller for a routine programmatically, but getting the error "Unable to convert value to type ..."
2
How can I pass a variable using the #selector function? And what to pass textField: UITextField?
0
adding comma separator for numbers, every third digit when typing



All Articles
Loading...
X
Show
Funny
Dev
Pics