Hey guys. I am trying to add UITableView do the View of my VC. On top of the VC I added to UIViews with the custom elements and they work just fine. However. When I am trying to add UITableView, it pushes UIViews from above out of the screen.
This is how I configured it. addNoteView is the UIView above. What am I doing wrong?
Many thanks for help
Code Block private func configureNoteTableView() { noteTableView = UITableView(frame: .zero) view.addSubview(noteTableView) noteTableView.layer.borderColor = UIColor.systemRed.cgColor noteTableView.layer.borderWidth = 5 NSLayoutConstraint.activate([ noteTableView.topAnchor.constraint(equalTo: addNoteView.bottomAnchor, constant: 0), noteTableView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 0), noteTableView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: 0), noteTableView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 0), ]) }
This is how I configured it. addNoteView is the UIView above. What am I doing wrong?
Many thanks for help
I fixed the issue by creating custom UIView that holds a UITableView inside.
However if anyone can explain why it did't work by simply laying out some constraints in a VC, I will be more than grateful
EDIT: It seems like I did not fix the issue with that at all. Table view does not populate and syntax error is the same
However if anyone can explain why it did't work by simply laying out some constraints in a VC, I will be more than grateful
EDIT: It seems like I did not fix the issue with that at all. Table view does not populate and syntax error is the same