Food Tracker error (Yes, Again)

Hi, I'm new for learning not only Swift but also programming.

I've been following Food Tracker tutorial and faced error today.

First one, this morning, I figured it out with spending an hour and half one google.

The lines tutorial gave me didn't work and the lines I fixed was below

Code Block
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) {
        
        // The info dictionary may contain multiple representations of the image. You want to use the original.
        let selectedImage = info[UIImagePickerController.InfoKey.originalImage] as? UIImage


and... now I have another error.
try to add the button to the stack and Xcode said 'error'

The lines are below

Code Block
private func setupButtons() {
// Create the button
let button = UIButton()
button.backgroundColor = UIColor.red
// Add constraints
button.translatesAutoresizingMaskIntoConstraints = false
button.heightAnchor.constraint(equalToConstant: 44.0).isActive = true
button.widthAnchor.constraint(equalToConstant: 44.0).isActive = true
// Add the button to the stack
addArrangedSubview(button)
}


and error occurs on addArrangedSubview (cannot find 'addArrangedSubview' in scope)

I spent another a couple of hours to fix it and thought that it was a good opportunity to improve my skill by fixing it. But I read lots of comments that TF has lots of bugs and it's old.

Should I finish this tutorial or stop following it?

Please give me advice for the future.

Thank you all.

Should I finish this tutorial or stop following it?

Depends on what you want to learn or whether you can find another better tutorial.

Learning how to fix the bugs of a tutorial would be a good exercise for you, but it may not be an efficient way to learn programming, especially for people who are in an early stage of learning.

Better find another.
Food Tracker error (Yes, Again)
 
 
Q