It seems if you create a UIButton programatically and set it as the inputAccessoryView of an object (UITextField in this case), it will not allow you to adjust the width and origin of the button. I've tried changing the x,y, and width values, but it does nothing; just height. Yet if I add a second button (calcBtn2) and add it to the view manually it allows you to adjust those values AND is also on a different origin system completely (top left, where inputAccessoryView seems to be bottom righ or maybe just bottom period). Is this a bug in Swift?
======================
let calcBtn = UIButton(frame: CGRect(x: 0, y: 0, width: view.frame.size.width, height: 60))
let calcBtn2 = UIButton(frame: CGRect(x: 0, y: 0, width: view.frame.size.width, height: 60))
calcBtn2.backgroundColor = colorLiteral(red: 0.9372549057, green: 0.3490196168, blue: 0.1921568662, alpha: 1)
calcBtn2.setTitle("Test", for: .normal)
calcBtn2.setTitleColor( colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0), for: .normal)
calcBtn.backgroundColor = colorLiteral(red: 0.9372549057, green: 0.3490196168, blue: 0.1921568662, alpha: 1)
calcBtn.setTitle("Calculate", for: .normal)
calcBtn.setTitleColor( colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0), for: .normal)
calcBtn.addTarget(self, action: #selector(MainVC.calculate), for: .touchUpInside)
self.view.addSubview(calcBtn2)
wageTxt.inputAccessoryView = calcBtn
priceTxt.inputAccessoryView = calcBtn
======================