The error is suggesting that the compiler is having trouble figuring out which init method should be invoked, so it's assuming you meant to call init(coder:).
But let's set that aside for a second. First, let's simplify your statement to eliminate some "noise". Rather than using CGRect(origin:, size:), you might use CGRect(x:, y:, width:, height:). That would yield (separating it on separate lines to make it a little easier to read):
let button = UIButton(frame: CGRect(
x: ChecklistViewController().view.frame.width / 2 + 117,
y: ChecklistViewController().view.frame.size.height - 70,
width: 50,
height: 50)
)
Second, the problem here is that that ChecklistViewController() syntax isn't actually referencing your existing ChecklistViewController. Every time it sees ChecklistViewController() it's creating a new instance of that view controller (so you probably have three instances, the original one and the two you accidentally created here). That's certainly not what you intended. If you were doing this in, one of the instance methods of the view controller itself, you'd just reference self, e.g.:
let button = UIButton(frame: CGRect(
x: self.view.frame.width / 2 + 117,
y: self.view.frame.size.height - 70,
width: 50,
height: 50)
)
A more subtle problem is that this code will only work if the frame of the view has been set. But if you have this code in viewDidLoad, the frame hasn't been set yet. If you did this in viewDidAppear, though, you could get away with this code. Generally, you'd use auto layout, to avoid this, e.g. something like:
let button = UIButton()
button.translatesAutoresizingMaskIntoConstraints = false
// do additional configuration of the button here
view.addSubview(button)
NSLayoutConstraint.activateConstraints([
button.centerXAnchor.constraintEqualToAnchor(view.centerXAnchor, constant: 117),
button.centerYAnchor.constraintEqualToAnchor(view.centerYAnchor, constant: -70),
button.widthAnchor.constraintEqualToConstant(50),
button.heightAnchor.constraintEqualToConstant(50)
])
Because we did this with auto layout, it means you can do this in viewDidLoad, if you want. Also, it means that if you rotate the device, the constraints will recalculate the frame automatically for you.
Having said all of this, the "missing argument for parameter 'coder'" might be a result of some other problem in the code. But, if you fix the declaration of the button, you might be able to better diagnose any other issue that might be in the code.